Could not find type "Player" in the current scope

if you have a quick look at the filesystem window in godot, do you have two scripts folders by any chance?

normally if it says that a class is hidden, its if its declared somewhere else as well. but if its only declared once, then having a look at this forum thread might help shed some light on it.

what you could try in the first instance, is to go into a script, then press Ctrl+Shift+F.
this will bring up the Find in Files box and you can search through all the scripts for any instances of the declaration for class_name for the Player and see if theres a duplicate.
image

it will show the results in the output window at the bottom that you can click on and take you directly to the script in question.

if that doesnt show any duplicates, then there is a thread that might be an alternative explanation.
it is a bit of a long thread, but im wondering if you may be experiencing the same.

Godot 4: Error at (2, 12) Class Player hides a global script class - Other Courses / Ask - GameDev.tv

2 Likes