Help,

I’m coding a game in unity. And I’m getting this error. Assets/mainmenu.cs(10,37): error CS1002: ; expected
Heres my file of code.

5266479–527010–mainmenu.cs (244 Bytes)

Exactly what it saids… you forgot a semicolon at the end of your line.

Note: Read your error before posting to the forums, this kind of mistakes are easy to spot and are the very fundamentals of programming… Also make your post more descriptive and add the code between code tags instead of linking a file. You’ll get more people that are willing to answer that way.

1 Like

Where?

MainMenu.cs line 10 position 37, I assume you didnt share the full file.

I did.

Assets/[COLOR=#ff4d4d]mainmenu.cs(10,37)[/COLOR]: error CS1002: [COLOR=#ff4d4d];[/COLOR] expected

mainmenu.cs(10,37)
Means mainmenu.cs file at line 10, and character 37, including indentations.
; expected - that is semicolon.
Just double click on that error, and VS will open, pointing into the line.

It loads notepad on linux.

How do I change the app loading to VS?

Nevermind. Can you show me a edited verison of the code of this?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class mainmenu : MonoBehaviour
{
public void Play()
{
SceneManager.LoadScene(“Game”)
}
}

First as @ProtagonistKun suggested, please change title, to be more descriptive.

5266845--527088--upload_2019-12-10_16-18-58.png

In Unity you should see something similar

Please read this.
** Using code tags properly **

So, good news, I got it working!