Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
"Property 'object3D' does not exist on type 'Element'" error when trying to access Element.object3D in A-frame with TypeScript

First, I'm Japanese student. So, please forgive my poor English. I'm developing a-frame library that make animation with anime.js in TypeScript now. When I tried to accessing Element.object3D to update value of position, TypeScript generated "Property 'object3D' does not exist on type 'Element'" error. Here is my code.

function updateValue(target: Element, attr: Attribute, value: number) {
switch (attr) {
    case "PositionX":
        target.object3D.position.setX(value)
    case "PositionY":
        target.object3D.position.setY(value)
    case "PositionZ":
        target.object3D.position.setZ(value)

}

I realize 'object3D' does not exist on Element but when import a-frame it exists. I tried to require("aframe") but this problem was not fixed. I apologize for the rudimentary nature of this question and my poor English, but I would be very grateful if you could answer it.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You probably need to install @types/aframe package, to have the typings for your typescript project.

After that, use Entity or Scene (I don't know which one is the one that you receive in updateValue but those 2 contain object3D.

function updateValue(target: Entity, attr: Attribute, value: number) {
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda