What is this error, And how do i link my player body to this skript.

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);
    }
}

6737542--776158--764af12bd156245bc9559de5a3b6adca.png

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