Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started by: marcusmattingly on August 21, 2015, 04:59:15 PM
-
I am new to DOTween, but WOW! DOTween is awesome! I am definitely picking up the pro version.
Now, my question.....How can I make something continuously rotate 360 around using code? Basically I have a coin I want to continuously spin.
Thanks and keep up the good work!
-
Hi Marcus,
I suggest you parent your coin in an empty GameObject so you can move it around indenpendently from it's rotation behaviour.
Using DoTween Pro, you can set a infinite loop settings for a relative local Y rotation.
See my attached image for the hierarchy and the DoTweenPro component options.
Otherwise, you can add a component to your CoinRotation object and rotate it by code:
transform.Rotate(Vector3.right, 1.5f);
-
Thanks!