Tween seems to reset back to original transform

Hello,

Here is my project:
https://playcanvas.com/project/540333/overview/20180309jjtweenlibrarysandbox

Im new to running tweens in 3D and followed the tutorial. I have it all ‘wired up’ similarly to the tutorial but for some reason in my project, the object resets to its original orientation when the tween completes. Theres some other random stuff in the project as well but I have disabled it all so only the tween library should be affecting the object.

To make sure its not the easing pack, Im forcing it to tween from a completely different starting orientation but it still resets to the objects original orientation. I feel certain somehow the localEulers are getting multiplied in somewhere.

Any help would be appreciated. Thanks!

Nevermind, I must have been trying to get too fancy somewhere. I replaced my ‘omni-tween’ script with the rotation only script and that doesnt have the problem. I’ll just stick t using separate scripts.

Thanks.

I was giving a look at your script but I can’t find what was causing the reset. It never happened with my tweens.
I could fork the project and debug more. Up to you.

No worries, the clean rotation script works fine. Im sure somewhere I messed up some object reference when trying to combine everything.

Thanks for taking a look.

1 Like

Actually, looks like its the Rigid Body. I removed that and it works regardless of which script I use. I guess somehow the physics engine has this side effect if you dont disable the Rigid Body during a tween. Does that sound accurate?

Thanks.

I didn’t use physics yet in Play Canvas but I read the when you have a rigidbody you should move/rotate the object using the methods of the rigidbody instead of the entity ones.

https://developer.playcanvas.com/en/api/pc.RigidBodyComponent.html#teleport

Yes thats true, you arent supposed to mix and match the physics with the transform lerping. Thanks for the reminder!