Problem with the Inspector

Hello! I am a small hobby dev and I got a problem with me inspector, It won’t show the variables, but I need to set them. When I try to execute the program it throws “You need to fix the scripts first” at me
This is my code:

using System.Collections;
using System;
using UnityEngine;

public class mouseLook : MonoBehaviour
{
    public float mouseSensitivity = 100f;
    public Transform playerBody;
    public float xRotation = 0f;


    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
    }
    void Update()
    {
        float mouseX = Input.GetAxis("Mouse X") *  this.mouseSensitivity * Time.deltaTime;
        float mouseY = Input.GetAxis("Mouse Y") *  this.mouseSensitivity * Time.deltaTime;
       
        xRotation -= mouseY;
        xRotation = Mathf.Clamp(xRotation, -90f, 90f);
        transform.localRotation = Quaternion.Euler(xRotation, 0f,0f)
        playerBody.Rotate(Vector3.up*mouseX);
    }
}

You have compile errors. They may or may not be related to this particular script.

You need to look through your console window and resolve any red compile errors. Until you do that, Unity will not be able to compile your code and any new variables you added will not show up in the inspector.

Problem with that is, it doesn’t show any errors
Neither MSVSC nor Unity does

Show a screenshot of your console window, especially including the small toggles at the top right of it?

which console Unity or MS?


And befor you ask, the error only points at the script.

this is how the inspector looks like:

See that little red icon on the top right of your console? You have an error, but errors are hidden in your console at the moment. Click that red icon to show the error.

And as I have said, that’s the error message that says, that the script is mising something, which I can’t give to it6936724--814987--mous.JPG

Oh, and I am running 2020.2.7f1.

That error is saying that line 23 in your code is missing a semicolon.

Look at line 23. Lo and behold there is no semicolon. You need a semicolon at the end of the line.

1 Like

Sometimes, I wonder, at how stupid I am, I’m used to working with compilers that show missing ones to me.
Anyways, thank you, wouldn’t have understood the errormessage