Horje
unity clamp rotation Code Example
unity clamp rotation
float rotationX = 0;
float rotationY = 0;
// you might also have some rotation speed variable
void Update() {
   rotationX += Input.GetAxis("Vertical") * Time.deltaTime;
   rotationX = Mathf.Clamp(rotationX, minRotationX, maxRotationX);
   rotationY += Input.GetAxis("Horizontal" * Time.deltaTime;
   transform.rotation = Quaternion.Euler(rotationX, rotationY, 0);
 }
how to chagne rotation in unity
transform.eulerAngles = new Vector3(0f, 180f, 0f); // rotates 180 degrees




Csharp

Related
c# dictionary get highest key Code Example c# dictionary get highest key Code Example
c# string array to string Code Example c# string array to string Code Example
convert ienumerable to list Code Example convert ienumerable to list Code Example
no context type was found in the assembly enable-migrations Code Example no context type was found in the assembly enable-migrations Code Example
Find an item in a list by LINQ Code Example Find an item in a list by LINQ Code Example

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