Skip to content

Spinning 360 degrees, using Tween.Rotation is a bit unwieldy. #137

Answered by KyryloKuzyk
octia asked this question in FAQ
Discussion options

You must be logged in to vote

You are correct on the part that it's not possible to animate rotation beyond 180 degrees when using Quaternion (transform.rotation). But it is possible to create 360 rotation with the help of transfrom.eulerAngles property, like this:

// Rotate 'transform' around the z-axis by 360 degrees in 1 second 
Tween.EulerAngles(transform, startValue: Vector3.zero, endValue: new Vector3(0, 0, 360), duration: 1);

The only caveat of using Tween.EulerAngles() is that you should always specify the startValue to prevent inconsistent results. Please read more on this here: https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Transform-eulerAngles.html

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KyryloKuzyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
FAQ
Labels
None yet
2 participants