I’m working on a first person game and have been following this tutorial to learn how to do it. I have all the code correct and have everything set up correctly as far as I know, but I’m still getting the error message "ArgumentException: Input Axis MouseX is not set up. I suppose I will also have this problem (after the mouseX one is solved) for Mouse Y. Here is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseLook : MonoBehaviour
{
public Vector2 mouseLook;
public Vector2 smoothV;
public float sensitivity;
public float smoothing;
GameObject character;
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
character = transform.parent.gameObject;
}
void Update()
{
Vector2 vct2 = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
smoothV.x = Mathf.Lerp(smoothV.x, vct2.x, 1 / smoothing);
smoothV.y = Mathf.Lerp(smoothV.y, vct2.y, 1 / smoothing);
mouseLook += smoothV;
transform.localRotation = Quaternion.AngleAxis(-mouseLook.y, Vector3.right);
character.transform.localRotation = Quaternion.AngleAxis(mouseLook.x, character.transform.up);
}
}
and a screenshot of the input settings:
Does anyone know how to solve this? Thanks!