using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mouselook : MonoBehaviour
{
public float mouseSensitivity = 100f;
public Transform playerBody;
// Start is called before the first frame update
void Start()
{
}
// 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;
playerBody.Rotate(Vector3.up * mouseX);
}
}
The spelling AND capitalization of the class MouseLook
must precisely match the file MouseLook.cs
One of them is lowercase in the screenshot above.
Thank you, its now working!
1 Like