Simple 180º sprite rotate

Hello,

I was wondering how can I rotate a simple sprite by 180º. However, I just do not want an normal rotation. I want a movement rotation. With this code, my sprite rotate right after the mouse click. I want that my sprite rotate slowly, so we can actually see it. I hope you can understand. Thank you.

public class Example : MonoBehaviour {

    void Update() {

        if (Input.GetMouseButton(0))

        {

		transform.Rotate (Vector3.forward * -90);

        }

    }
}

Hi!

To do this you can use de Quaternion.Lerp method.

:slight_smile:

Hello Annafuste,

I’ll play with Quaternion.Lerp and see if I can do it. Then I’ll write. Thanks! :slight_smile: