lojjic / aframe-troika-text

An A-Frame component for rendering 3D text using troika-three-text
MIT License
71 stars 12 forks source link

Animating opacity doesn't work #55

Closed pranav-pavithran closed 2 years ago

pranav-pavithran commented 2 years ago

I was trying to give a flashing animation to the text <a-troika-text animation="property: opacity; from:0; to: 1 ; loop: true; dur: 5000" color="#EF2D5E" value="Hello world!"></a-troika-text> Same code worked on normal But it's not working on troika-text,

lojjic commented 2 years ago

Does that work for other AFrame entities? Opacity is a property of the material so it seems like you'd need to target material.opacity...?

pranav-pavithran commented 2 years ago

Yes. It's working on primitive entities, when i targeted components.material.material.opacity but not with troika-text <a-entity geometry="primitive: box" material="color: red" animation="property: components.material.material.opacity; to:0; dur: 2000; easing: linear; loop: true"> </a-entity>

this one didnt work <a-entity position="0 2 -3" troika-text="value: Hello! ;font:./MarckScript.ttf ; color:#EF2D5E" troika-text-material="shader: standard; " animation="property: components.material.material.opacity; to:0; dur: 20000; easing: linear; loop: true"> </a-entity>

lojjic commented 2 years ago

I wouldn't expect property: components.material.material.opacity; to work because there is no material component in use. You need to find a valid path. A quick inspection shows me the following works, there may be other valid paths too...

property: components.troika-text.troikaTextMesh.material.opacity

pranav-pavithran commented 2 years ago

It works, thanks.