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.
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.
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