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. Dismiss Notice

Class error. I am new pls help

Discussion in '2D' started by nigelolmarbles, Oct 11, 2020.

  1. nigelolmarbles

    nigelolmarbles

    Joined:
    Oct 11, 2020
    Posts:
    4
    Screenshot_1.png Screenshot_1.png
    Why the MonoBehaviour class is not colored and why i cant define rigidbody2d as rb. I am at the beginning of coding and unity. I added rigidbody2d and collidor2d components to my player and trying to make it move but stuck at the first. Please someone help.
     
  2. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    Line endings are semi colons in C#. In the future when you have a problem and looking for help make sure to clip us the error message from the console.
    Code (CSharp):
    1. public Rigidbody2D rb;
     
  3. nigelolmarbles

    nigelolmarbles

    Joined:
    Oct 11, 2020
    Posts:
    4
    nothing happend
     
  4. nigelolmarbles

    nigelolmarbles

    Joined:
    Oct 11, 2020
    Posts:
    4
    There is no error message. I watch tutorials to make my player walk with w a s d. Doing the exact same thing but when they add script and opened it in visual studio the MonoBehaviour class was cyan colored. Mine is not
     
  5. nigelolmarbles

    nigelolmarbles

    Joined:
    Oct 11, 2020
    Posts:
    4
    Rigidbody2D is not colored too
     
  6. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369