Tween Documentation Fix

Hey there,

I was just reading the Tween documentation and noticed the sample codes need some fixing up after trying to work out why my tweens were acting strange.

This sample using .to when it should be using .rotate

.to(new pc.Vec3(180, 0, 180), 1.0, pc.Linear)

I haven’t checked the other samples, but it might be worth double checking them.

1 Like

@moderators on the repo it says:

If you are dealing with rotations you should use rotate instead of to. This takes euler angles and uses an internal quaternion to slerp between angles. For example:

entity.tween(entity.getLocalEulerAngles()).rotate({x: 0, y: 180, z: 0}, 1.0, pc.Linear);

Do both ways work?

Good spot @ed-spatialsauce!

Fixed in PR:

1 Like