change rotation over time unity code example
Example 1: unity how to change rotation
transform.eulerAngles = new Vector3(0f, 180f, 0f);
Example 2: rotation over time unity
public float smooth = 1f; private Quaternion targetRotation; void Start(){ targetRotation = transform.rotation; } void Update () { if (Input.GetKeyDown (KeyCode.Space)) { targetRotation *= Quaternion.AngleAxis(60, Vector3.up); } transform.rotation= Quaternion.Lerp (transform.rotation, targetRotation , 10 * smooth * Time.deltaTime); }