Is there anything wrong with this script?

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);
    }
}

How to understand compiler and other errors and even fix them yourself:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

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

Yes! I figured that out, now there is a “,” missing!

Well, line 12 appears incorrect. Appears you didn’t declare a variable name.

1 Like

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:

https://forum.unity.com/threads/ass…3-syntax-error-expected.1039702/#post-6730855

1 Like