Horje
smooth rotation unity Code 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);
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
smooth rotation unity

float turnTime = 50f;
Quaternion target = Quaternion.Euler(mainCamera.eulerAngles.x, mainCamera.eulerAngles.y, 0f);
transform.rotation = Quaternion.RotateTowards(transform.rotation, target, turnTime * Time.deltaTime);





Csharp

Related
C#: convert array of integers to comma separated string Code Example C#: convert array of integers to comma separated string Code Example
c# alphabet array Code Example c# alphabet array Code Example
find gameobject with tag Code Example find gameobject with tag Code Example
serilog log level hierarchy Code Example serilog log level hierarchy Code Example
create abc array c sharp Code Example create abc array c sharp Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10