Rotation Question

Hey!

I would like to rotate a Object with rotation a to rotation b. I don’t want to set the rotation by setting transform.rotation = … ; I would like to get a smooth rotation to a certain euler angle. I hope someone can help me… Thanks

You can make smooth rotations with transform.rotation with a lerp. Apply this script to your object and it should work.

using UnityEngine;
public class SmoothRotate : MonoBehaviour 
{
	public Quaternion newRotation;
	public float duration = 0.01F;
	
	void Update () 
	{
		transform.rotation = Quaternion.Lerp(transform.rotation, newRotation, duration*Time.deltaTime);
	}
}