GameObject Class isn't working in C#. Error: CS1061 (Help Please)

I am new to Unity going through their free classes and on Lesson 1.3 part 2 they teach you to do “public GameObject player;” and says in the video “Things like our Obstacles or our Vehicle are GameObjects in our Project.” but that does not seem to be the case for me.
When I type GameObject in my IDE it does not recognize it as a class and the coloring of the letters do not change.

I’m new so I am sorry if I got any terms wrong.

Try closing your IDE and then from the Unity Editor go to Assets → Open C# Project. This should open your IDE with the project files generated to include the Unity API so that Intellisense works properly.

If this doesn’t work, you may need to delete all your project files (basically anything outside your Assets and ProjectSettings directories for your project) and do the process again. 99% of the time, this resolves the issue.

Thanks so much!! Exiting out of Visual Studio and re-opening it fixed the issue.

1 Like