Show/hide with animation

Hello, I’m going to remove the visibility of a box. I can do this in a simple way, but what I want is to do it with animation/effect. Like fadein-fadeout in JS. Is this possible in babylonjs? I couldn’t even find an example of that.

Like this: jQuery Effects - Fading (

Sure is. You can either use the render loop or an animation.
Here an example using the render loop. For animation, visit the doc.
Note that you can also do it through the material.alpha.


Thanks for your reply. After some more research, I found the solution through an example like this.

smooth | Babylon.js Playground (

1 Like

Yes, through an animation. As I said, you can also use it on the material.
That’s my fun with BJS is that there is (nearly) always more than one way to achieve something.
Enjoy and take care, :sunglasses:

1 Like

You are so right, thanks :).

1 Like