I am a noob who downloaded unity for practice, and right now I tweak the basic codes to practice and I cant seem to make the fps controller (mouselook) to look all the way up, or all the way down, and its bugging me.
I changed this,
public float minimumY = -90F;
public float maximumY = 90F;
but it didn’t make any difference. I even changed it to 180, if someone posts an answer can you also tell me how it works?
Maybe you’re modifying the wrong MouseLook: there are two scripts, one attached to the player (which only rotates horizontally) and the other attached to the camera - this one rotates the camera up and down, and checks minimumY and maximumY. Anyway, these limits should never reach -90/90 degrees: a kind of “division by zero” condition appears when the angle is too close to -90 or 90 degrees, and the camera gets crazy (even worse if passing these limits).
To look Up and Down I have this as my looking up and down script
public float mouseSensitivity = 100f;
float xRotation = 0f;
Cursor.lockState = CursorLockMode.Locked;
float MouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
xRotation -= MouseY;
xRotation = Mathf.Clamp(xRotation, -90, 90);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);