how to stop rotate on an object in unity c# code example
Example: unity how to lock rotation
public float lockPos;
void Update()
{
// Locks the rotation.
transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, lockPos, lockPos);
}