Demigiant Forum

Unity Assets => DOTween & DOTween Pro => Topic started by: birdkingz on December 07, 2015, 05:14:24 AM

Title: Rotate infinitely
Post by: birdkingz on December 07, 2015, 05:14:24 AM
I'm trying to find a way to rotate Sprite infinitely.

One of the ways that I found is:
sprite.transform.DOLocalRotate(new Vector3(0.0f, 0.0f, deg), 1.0f).SetLoops(-1, LoopType.Incremental).SetEase(Ease.Linear);

But the above problem is it doesn't work if my object has been rotated before tweening it.
For example, the sprite might be starting at Rotation-Z=90 degree

So I wanna ask how can I do it in a relative way?
For example
I just need to specify for every N seconds it will rotate X degree.
Title: Re: Rotate infinitely
Post by: Daniele on December 07, 2015, 10:36:12 AM
Hi,

If you chain a SetRelative (http://dotween.demigiant.com/documentation.php?api=SetRelative) to your tween, the end value you set will be taken as relative.

Cheers,
Daniele
Title: Re: Rotate infinitely
Post by: birdkingz on December 08, 2015, 03:36:36 AM
Thanks!