Hi everyone, how do you lock the Main Camera’s rotations? I tried putting the following below in update but I get this error expression denotes ‘type’ where a ‘variable’ ‘value’ or ‘method group’ was expected.
Camera.main.transform.rotation = Vector3(0,0,0);
I’m not sure what you mean by “locking” since the camera will only move if there is a script attached that moves it. But in terms of the above, transform.rotation is a Quaternion, not a Vector3. So to set a Quaternion to no rotation, use Quaternion.identity;
Camera.main.transform.rotation = Quaternion.identity;
You could also use eulerAngles which is a Vector3:
Camera.main.transform.eulerAngles = Vector3(0,0,0);