unity smooth rotation 2d code example
Example: unity smooth rotation 2d
float targetAngle = 90;
float turnSpeed = 5;
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (0, 0, targetAngle), turnSpeed * Time.deltaTime);
float targetAngle = 90;
float turnSpeed = 5;
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (0, 0, targetAngle), turnSpeed * Time.deltaTime);