Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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
 
PREVIOUS NEXT
Tagged: #smooth #rotation #unity
ADD COMMENT
Topic
Name
2+3 =