0

I import a animated gltf 2.0 model in a A-Frame scene.

I want to set its opacity to 0.5. But it doen't work, even I try to modify the value with object3D class.

Hier is the demo project on glitch: https://glitch.com/edit/#!/animated-gltf-opacity

Thanks for any help.

L3 Zhang
  • 95
  • 1
  • 13

1 Answers1

1

You need to wait until the model is loaded, throw Your code to an event listener:

this.el.addEventListener("model-loaded", (e)=>{//change opacity})

Check it out here.

Piotr Adam Milewski
  • 14,150
  • 3
  • 21
  • 42