C# unexpected symbol error

im new to programming, this is my first code so i would really appreciate some help.

I have this script that keeps giving me two errors, ive checked on the internet and i couldnt find a solution.

The script:

void Update()
{
if (Input.GetMouseButtonDown(0) && !UnityEngine.Eventsystem.Eventsystem.current.IsPointerOverGameObject())
}

The errors:

Assets/Scripts/World_interaction.cs(16,4): error CS1525: Unexpected symbol `}’

Assets/Scripts/World_interaction.cs(16,5): warning CS0642: Possible mistaken empty statement

Line 16 is the line with the end curly bracket.

Hey, welcome to the scripting community :slight_smile: For future reference, it really helps if you show the entire script and you use the code tag. The code tag aligns things a little better and allows for debugging to go a lot smoother. (Little 1’s and 0’s thing at the top of the text editor)

Appears you forgot the squiggly brackets at the end of your if statement. Here’s what it should be:

void Update(){
   if(Input.GetMouseButtonDown(0) && !UnityEngine.Eventsystem.Eventsystem.current.IsPointerOverGameObject()){
      ...
   }
}