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);
}
Also in C#:
- month number to text in c#
- @Html.ActionLink
- Could not load file or assembly 'Ubiety.Dns.Core, Version=2.2.1.0
- call a function c#
- c# get type of object
- populate combobox from array c#
- c# new thread
- c# new dictionary linq
- unity rb.addexplosionforce 2d
- how to disable device guard or credential guard vmware
- how to allow user import image c#
- iterate through xpdictionary devexpress
- c# use hashtable check if key exists
- unity movement on forward
- compose graphql query string in c#
- winforms messagebox with button
- unity rotate around point
- c# how to refreshyour bindingsource
- c# inotifypropertychanged best practices
- convert int to double c#
- how to set progress openedge driver name for odbc connection c#
- c sharp list indexer
- unity to integer
- how to convert object in string JSON c#