Assets\Scenes\Player.cs(6,12): error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)

I was trying to make a character controller from a tutorial but unlike the tutorial the error message Assets\Scenes\Player.cs(6,12): error CS0246: The type or namespace name ‘Player’ could not be found (are you missing a using directive or an assembly reference?) pops up

alt text

What would you recommend me doing to either troubleshoot this issue, or fix it?


Thank You

Well, there are several things wrong here. First of all, do not post images of code. There’s a button to format code directly in the editor.

As you probably know MonoBehaviour derived classes need to have the exact same class name as the file they are contained in. Since the error you posted is in the “Player.cs”.file, you already have done something wrong as your class is called “Charcontroll” and not Player.

Your actual error is pointing at the variable named “playerInput” in line 6 which is of type Player. This is very confusing as the Player class should be inside the Player.cs file. So it seems you have mixed up quite a bit here. Since we only see an image of the first 6 lines here, we can’t tell you what you should do. It’s your project and naming your components and files correctly is your task. We don’t know what other files you may have that may have similar issues.