Help with syntax!

I keep getting a syntax error over this tutorial I am following and I don’t know where it is here is the code.

  public Rigidbody2D theRB;

   public float moveSpeed = 5f;

   private Vector2 moveInput;
   private Vector2 mouseInput;

   public float mouseSensitivity 1f;


    // Start is called before the first frame update
    void Start()
    {
      
    }

    // Update is called once per frame
    void Update()
    {
        moveInput = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));



        theRB.velocity = moveInput * moveSpeed;


    }
}

Is this the entire file? Because the entire header is missing, things like:

using UnityEngine;

public class Whatever : MonoBehaviour
{

You have provided almost no information, like what is the contents of the error message as that tells us what the error is and on what line.
But from a guess, I would say you should look a line 8 and compare what is different about it when looking at line 3.

public Rigidbody2D theRB;

   public float moveSpeed = 5f;

   private Vector2 moveInput;
   private Vector2 mouseInput;

   public float mouseSensitivity 1f;

Hint: =

1 Like

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

Remember: NOBODY memorizes error codes. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

The important parts of an error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

1 Like

public float mouseSensitivity = 1f;