I am creating an FPS and made a script for my CharacterController (C#). I have an error that states:
“Assets\Camera_Control.cs(5,44): error CS1514: { expected.” Here is the code, can you help me fix the error?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Camera_Control : MonoBehaviour
public enum RotationAxis{
MouseX = 1,
MouseY = 2
}
public RotationAxis = RotationAxis.MouseX;
public float sensHorizontal = 10.0f;
public float sensVertical = 10.0f;
public float _rotationX = 0;
// Update is called once per frame
void Update() {
if (axes == RotationAxis.MouseX) {
transform.Rotate(0, Input.GetAxis("Mouse X") * sensHorizontal)
} else if (axes == RotationAxis.MouseY) (
_rotationX -= Input.GetAxis("Mouse Y") * sensVertical;
float rotationY = transform.localEulerAngles.y;
transform.localEulerAngles = new Vector3(_rotationx, rotationY, 0);
}
}
Hint: when the compiler tells you it expects a “{” at line 5, position 44, it usually means it. You may want to look there and try to figure out what to do next.
With programming pretty much 100% of every character, numeral, letter and symbol must be spelled right, capitalized right, punctuated right, and actually spaced right (or not spaced as the case may be).
To save you time, as I posted above, how to understand compiler and other errors and even fix them yourself: