Search Unity

"Can't add script behaviour AssemblyInfo.cs. The script needs to derive from MonoBehaviour!"

Discussion in 'Scripting' started by Deleted User, Apr 18, 2021.

  1. Deleted User

    Deleted User

    Guest

    Hello.

    After digging around, I decided to make a totally new script without changing anything and tried dragging it on to a cube. For some reason, it won't work.
    I was following a learn tutorial with the car that drives over boxes and after adding a new public float like in the video "public float turnSpeed;" the script and the entire project broke.
    What I did to test this is in the picture.
    I'm brand new to Unity and might switch over from Unreal, but won't make the jump if this is something to expect all the time. Screenshot 2021-04-18 at 14.58.58.png
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    cannot see the second image, but usually that happens if you renamed script (the actual file or the class name) and it hasn't compiled yet, or maybe theres some related errors in console that prevent it from compiling. (can you check console window)
     
  3. Deleted User

    Deleted User

    Guest

    Thank you. There is no second picture btw. it was a failed imgur upload.