Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

257
Vistas
"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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda