Demigiant Forum

Unity Assets => DOTween & DOTween Pro => Topic started by: marcusmattingly on August 21, 2015, 04:59:15 PM

Title: Basic rotation question
Post 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!
Title: Re: Basic rotation question
Post by: Jo Simard on August 21, 2015, 06:45:00 PM
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);
Title: Re: Basic rotation question
Post by: marcusmattingly on August 21, 2015, 11:03:05 PM
Thanks!