Rotate infinitely
« 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.



  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Rotate infinitely
« Reply #1 on: December 07, 2015, 10:36:12 AM »

If you chain a SetRelative to your tween, the end value you set will be taken as relative.


Re: Rotate infinitely
« Reply #2 on: December 08, 2015, 03:36:36 AM »