Hello Everyone.
I have a problem with script in unity 2D. I wrote a script then i saw this error in unity:
Assets\Move.cs(9,5): error CS0246: The type or namespace name ‘RigidBody2D’ could not be found (are you missing a using directive or an assembly reference?)
This is my code:
Can you help me?
The error is telling you what is wrong and on what line(9) and column (5). Here’s the docs. As you can see, it’s lowercase “b” so “Rigidbody2D”. C# is case sensitive. I’m actually surprised Intellisense doesn’t present you with it correctly.
Also, you’ve put a “FixedUpdate” method inside another method “Update” which is wrong. They are separate methods.
It’s also easier to post code as text and not images by using CodeTags .
Note: There is no such thing as Unity 2D. 
Hope that helps.
1 Like