Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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

Discussion in 'Getting Started' started by Quazink, May 31, 2022.

  1. Quazink

    Quazink

    Joined:
    May 31, 2022
    Posts:
    2
    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.
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    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.
     
  3. Quazink

    Quazink

    Joined:
    May 31, 2022
    Posts:
    2
    Thanks so much!! Exiting out of Visual Studio and re-opening it fixed the issue.
     
    Schneider21 likes this.