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

174
Vistas
How to access child properties in other modules in native JavaScript?

in module 1 I have:

   `setMaterial()
   {
         this.material = new THREE.ShaderMaterial({
         transparent: true,
         uniforms:
          {
          uAlpha: { value: 0}
          },
         //wireframe: true,
         vertexShader: 
         void main()
             {
             gl_Position = vec4(position, 1.0);
             }
              ,
         fragmentShader: 
         uniform float uAlpha;
         void main()
         {
             gl_FragColor = vec4(0.0, 0.0, 0.0, uAlpha);
         }
    
       })

     }

in a second module I have:

my instance

    this.material = new Loading()

and the gsap I want to recive the property:

 setLoaders()
  {
     const loadingManager = new THREE.LoadingManager(
        // Loaded
  () =>
  {
   
    gsap.to(this.material.uniforms.uAlpha, { duration: 3, value:  0})
  },

if I add anymore child properties on the instance it e.g.

   this.material.uniforms = new Loading()

I am given a ERROR:

  `Cannot set properties of undefined (setting 'uniforms')
   `

how do I get the Uniforms then the uAlpha?

about 4 years ago · Juan Pablo Isaza
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