I followed Brackeys 4 year old tutorial on a first person controller and it worked just fine, The sensitivity was a bit low but I just increased it and everything was fine
But when I downloaded some models (couch, chair, etc…) and then stood on them the sensitivity went wild i tried decreasing it but now the camera barely moves
Here is the tutoriel
and Here is the code just in case
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseLook : MonoBehaviour
{
public float MouseSensitivity = 100f;
public Transform playerBody;
float xRotation = 0f;
// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}
// Update is called once per frame
void Update()
{
float mouseX = Input.GetAxis("Mouse X") * MouseSensitivity * Time.deltaTime;
float mouseY = Input.GetAxis("Mouse Y") * MouseSensitivity * Time.deltaTime;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
playerBody.Rotate(Vector3.up * mouseX);
}
}
I honestly don’t even know where to troublshoot the problem
You could just clamp the sensitivity, Force it to not be allowed to go above or below a certain threshold. When objects collide in Unity it can create very weird behaviours if you do not have code wrote out to stabilise it for when this happens.
– anon31744181can you show me how to clamp the sensitivity
– Hussain-idiot