i was following a tutorial (because im new to unity) and when i went to go test it, it said there were "Complier errors" and it said it was in this script:
public class MoveCamera : MonoBehaviour
{
[SerializeField] private float sensX;
[SerializeField] private float sensX;
Camera cam;
float mouseX;
float mouseY;
float multiplayer = 0.01f;
float xRotation;
float yRotation;
private void Start()
{
cam = GetComponentInChildren();
Cursor.lockstate = CursorLockMode.Locked;
Cursor.visible = false;
}
private void Update()
{
MyInput()
cam.transform.localRotation = Quaternion.Euler(xRotation, 0, 0);
transform.rotation = Quaternion.Euler(0, yRotation, 0);
}
void MyInput()
{
mouseX = Input().GetAxisRaw("Mouse X");
mouseY = Input().GetAxisRaw("Mouse Y");
yRotation += mouseX * sensX * multiplayer;
xRotation -= mouseX * sensX * multiplayer;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
}
}
thanks, and greetings,
cooper
↧