3D Object Fade After Animation Complete
Does anyone have a script for making a 3D object fade out (either the object or material) after the animation has completed? I've seen scripts for sprites, but can't figure it out for a 3D animation. For context, I have a snowball object/animation that ends upon impact and I want it to fade/disappear gradually after the animation is completed. Thank you!
Hi Jessie,
You can actually do this effect without writing any code, using the Tween System and Behavior Script.
You can follow the tweening guide to import the tween manager to your project, then you can set up an alpha tween that looks something like this:

Next, follow the Behavior Script guide to download and add BehaviorScript.js to your project. Add BehaviorScript to an object and set it up like this:
For Target Object in the Response section, set it to the object that holds your alpha tween.
Here's a quick example project I made to show this in action: download project
Let me know if you have any questions!
Hey Jacob,
following the above example, I am looking for a solution that lets me fade out Objects as soon as they are reaching a certain height above ground. My context is a Wall that scatters and the rocks are falling down. To avoid that "people get hit" by the falling pieces, I´d like to fade them out before "hitting" the ground. I imported the wall and the "destruction" as an animated 3d mesh, so I have many pieces to deal with (about 20 pcs).
Would you lead me to a working solution?
Thanks in advance,
cheers eL
Hey eL Be,
Assuming each rock has its own Mesh Visual, you can add a script like this to each object to make it fade out based on height:
Adjust "startFadeHeight" to the height you want the object to start fading out. Adjust "fadeOutHeight" to the height you want the object to be completely invisible.
Also, make sure the rock material has blend mode set to "Normal" or anything else that supports transparency.
Let me know if you need any more help!
Jacob