unity-tweens
unity-tweens copied to clipboard
360 rotation tween functions don't work.
Describe the bug 360 rotation tweens doesn't seem to be working.
To Reproduce Steps to reproduce the behavior:
- Create an object in the scene.
- run
TweenLocalRotationXfunction on it, eg:
gameObject.TweenLocalRotationX(360f, 1f).SetEaseBackIn()
Expected behavior Object should rotate 360 degrees around x Axis over 1000ms.
Screenshots N/A
Desktop (please complete the following information):
- OS: windows
- Version: Latest
Smartphone (please complete the following information): N/A
Additional context N/A
Yes I've just come across this as well. Can't rotate past 180 or -180 when using TweenLocalRotationZ on a RecTransform OS: windows Version: Latest
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
small bump to reopen it perhaps?
@jeffreylanters I'm seeing this issue as well, I believe it's related to the use of Quaternion.Euler with values greater than 180.
For anyone with this issue, as a workaround you can just tween a float value and manually assign the rotation.
this.TweenValueFloat(360.0f, 1.0f, value =>
{
this.transform.localRotation = Quaternion.Euler(Vector3.one * value);
});
This is intended behavior, since when an object is rotated to for example to 355, and you want it to go back to 0, you most likely don't want it to rotate back a full circle, but rather just the 5 degrees. Otherwise you'd had to keep track of its rotation all the time in order to prevent this from happening.
Derek's solution is the way to work around this. But I will look into an option to disable this behavior in the near future.