Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!