Unity Question | Sololearn: Learn to code for FREE!


Unity Question

So I'm trying to make a 2d game with Unity. Unity doesn't seem to understand what "Rigidbody2D" is. I keep getting this error: "The type or namespace name "Rigidbody2d" could not be found" (I can't remember the exact error atm" The error occurs when I do this: private Rigidbody2D rb; There's no typo. Extensive googling shows it should be "Rigidbody2D" and nothing is working. Can anyone identify the issue? Edit: Yes, the error displays "Rigidbody2D" as "Rigidbody2d" Not sure if that has something to do with it, but I checked probably 50 times and I definitely typed "Rigidbody2D"

11/1/2019 6:30:40 PM

Daniel Cooper

2 Answers

New Answer


Do you have using UnityEngine; at the top of your script?


Frenchtoast Yep. It adds it automatically. I'll send my code when I get home at 11 or 12. it's 1:48 now.