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 error screenshot is a attached to this thread too.
The error points to line 24, char 47. But knowing the line number is enough to get your attention to the line. You are missing a ; at the end of line 24, which is exactly what the error tells you.
Thank you so much! Now there is another one:
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);
}
}
I do think if you check your code a bit, you’ll solve many of these as normal debugging. Note, caps matters. So check out the line it points to and then look at your declared transform variable.
Thank you, now it works. I will in the future take a closer look before posting on here.
We all have to learn these things. Just trying to help you out so you don’t have to rush here for every error (and thus slow down your production). The error codes are pretty helpful when it comes to syntax errors.