Godot Version
v4.3.stable.official [77dcf97d8]
Question
I am trying to make a 2D game.
The game was working perfectly fine not long ago. I have an Inventory scene, and a new hotbar scene. I was trying to make the hotbar scene inherit the inventory scene when the issue randomly appeared. I have little clue as to what I did that might’ve triggered it.
The error:
Parser Error: Class "PlayerInventory" hides a global script class.
Troubleshooting Efforts
I conducted a search using PowerShell, and it just shows that it’s being referenced in two other scripts, which should be the case, as that has remained unchanged for most of its development.
I tried renaming the class, but the references immediately stop working.
I then went into the references and reformatted them too, but then I got the same error.
I tried removing the class from the files entirely, and the same thing happened.
I checked my autoloads, and I didn’t note anything weird. I also deleted my .godot folder. Restarted my computer. Nothing.
When I CTRL+LCLICK PlayerInventory
, it takes me right to the same “inventory.gd” script that originally spat out the error.
Thoughts
I’m sure the solution is something small and silly but right now, I don’t know what to do and I feel like I’m running out of options. It was working perfectly fine before, so I’m confused.
I found this comment on a similar thread that provided this solution:
Solution to similar thread
But to be honest, I don’t understand what it’s saying for me to do, and the thread was never resolved so I don’t even know if this is the right solution.
If it is, I’d appreciate an explanation as to what’s happening here.
If any more screenshots or information is needed, let me know!