Search Unity

Error

Discussion in 'Getting Started' started by LukiCreator, Jun 30, 2020.

  1. LukiCreator

    LukiCreator

    Joined:
    May 20, 2020
    Posts:
    1
    So I followed a tutorial and changed a bunch of code and everytime i run the code i get this error:
    ArgumentException: Input Axis mouse X is not setup.
    To change the input settings use: Edit -> Settings -> Input

    Can someone tell me where am i making a mistake and how to fix it?
    Code:
    public class movement : MonoBehaviour
    {
    [SerializeField] private float mouseSensitivity;

    private float xAxisClamp;

    void Start()
    {
    xAxisClamp = 0.0f;
    Cursor.visible = false;
    Cursor.lockState = CursorLockMode.Locked;
    }

    private void Update()
    {
    float mouseX = Input.GetAxis("MouseX") * mouseSensitivity * Time.deltaTime;
    float mouseY = Input.GetAxis("MouseY") * mouseSensitivity * Time.deltaTime;
    xAxisClamp += mouseY;
    transform.Rotate(-transform.right * mouseY);
    void ClampXAxisRotationToValue(float value)
    {
    Vector3 eulerRotation = transform.eulerAngles;
    eulerRotation.x = value;
    transform.eulerAngles = eulerRotation;
    }
    }
    }