How can I add an animation to a message?

I want to apply an animation like this:
https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_animate-top

But I do not know how to do it right, I guess I can get my entity position and the final position to do this:
direction.sub2(initialPosition, finalPosition);

And updating it, but how can I set a 3 seconds time for the animation? I don’t know if I explained myself.

Hi @Axel_Saucedo,

You can use to the Playcanvas tween library to easily add animations to any entity. Take a look here:

https://developer.playcanvas.com/en/tutorials/tweening/

2 Likes