Cannot instanciate script because class can't be found C#

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The Glitch

I have gotten this error:

E 0:00:00:0793   can_instantiate: Cannot instance script because the associated class 

could not be found. Script: 'res://Players/Player.cs'. Make sure the script exists and contains a class definition with a name that matches the filename of the script exactly (it's case-sensitive).
 <C++ Error> 
Method/function failed. Returning: false
 <C++ Source> modules/mono/csharp_script.cpp:2301 @ can_instantiate()

The class names match up with the filenames, how do i fix this.

And what method or code are you using to instantiate your script, assuming it even compiles? What does Player.cs look like?

spaceyjase | 2023-04-19 14:00

Just a class definition:

public partial class Player : CharacterBody2D


The Glitch | 2023-04-19 14:13

Also the script name is the same as the class name. (Capitals match)

The Glitch | 2023-04-19 14:15

The same problem I have and there’s absolutely nowhere to find an answer. I am getting tired of getting stuck like this everywhere, with everything, I am giving up on software