Is it possible to use tween in update section for animation?

Hello,
I am wondering how to :
a- Make a tween rotation
b- make it controlled by a key

The end goal is to have a character that has a running animation while you hit w, but it actually tweening. I have looked for tween rotation and I couldn’t find it,

Hi @Codeknight999,

Check the second example on this page, it explains how to use a tween rotation:

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

Not sure though how you’d use a tween in a player controller, usually using regular vector lerping in an update method makes more sense.

I found the rotation, I don’t know how I missed that the first time. How would I do vector leaping?

You use the following methods:

https://developer.playcanvas.com/en/api/pc.Vec3.html#lerp

https://developer.playcanvas.com/en/api/pc.math.html#lerp

https://developer.playcanvas.com/en/api/pc.math.html#lerpAngle

Check the model viewer / orbit camera controller, it utilizes these methods to smoothly animate from one position the other (it’s available when you create a NEW project).

Thanks!