Rotate towards 270 degrees,Rotate Towards 270

Hello everyone, basically i want to rotate smoothly as Rotate Towards do, but i had a problem when i want to rotate from 0 to 270 degrees unity detect the fastest way to do it, what is not the way that i want.

What shoud i do?152682-ejemplo-rotacion.png

Hello there.

Then make the rotation yourself. Do not use RotateTowards. You should use

Object.tranform.Rotate(x,y,z)

If you create a corutine, each frame the object will rotate the amount you want, for example:

IEnumerator RotateObject()
 {
  Object.tranform.Rotate(x,y,2);
  yield return null;
  if (Object.transform.eulerAngles.z < 270)
   { 
     StartCoroutine(RotateObject);
   }
 }

And check if rotation reached the angle you want.

This way, each frame will rotate 2ยบ in z axys and check if need to continue rotating at next frame. Once Z>270 corutine will stop calling itself.

Good luck!