I just downloaded unity yesterday and started watching the guide from Brackeys I did everything exactly with the guide but something went wrong when I started manipulating the Rigitbody component
using UnityEngine;
public class move : MonoBehaviour {
public Rigidbody rb;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
in these three lines of code, two of which were written by the unity engine itself, the error Assets\PlayerMovement.cs(6,12): error CS0246: The type or namespace name âRigitbodyâ could not be found (are you missing a using directive or an assembly reference?)
here is a screenshot from which I copied. What am I doing wrong?
To elaborate a bit on Acidâs answer: the error isnât in the script you shared. Itâs on line 6 of PlayerMovement.cs, as the error message is telling you.
Did you read the error prior to posting this thread and then try to look at the line it specified? If you canât figure out where the line is itâs the first number right after the script name in parenthesis. You can ignore the error code. The text is saying you gave a name and it canât find it. Clearly the name is wrong.
Another way of finding the error is to simply double click the error in the console. Unity will open Visual Studio (or another IDE youâve selected) and move the cursor to the line the error occurs on.
Within Visual Studio the error will be pointed out by a red squiggly line under the name. If you hover the mouse over the squiggly line it will provide more details.