Answers for "smooth rotation unity"

C#
3

smooth rotation unity

Vector3 targetRotation = path[i].transform.position - transform.position;
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(targetRotation), 4f * Time.deltaTime);
//LookRotation points the positive 'Z' side of an object in a specified direction
//FromToRotation creates a rotation that from one direction to another direction
Posted by: Guest on March-15-2021
1

unity smooth rotation 2d

float targetAngle = 90;
 float turnSpeed = 5;
 transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (0, 0, targetAngle), turnSpeed * Time.deltaTime);
Posted by: Guest on March-23-2021
0

unity smooth rotation 2sd

float targetAngle = 90; float turnSpeed = 5; transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (0, 0, targetAngle), turnSpeed * Time.deltaTime);
Posted by: Guest on March-23-2021

C# Answers by Framework

Browse Popular Code Answers by Language