, then i created a new script, copied and pasted the old script into the new one and despite having it connected to the player, it still didn’t work
In console, it looks like this :
Found what the problem was, sorry for the fuss, i said myself I’m gonna check it one more time, then I’m gonna make some tea. And I found the error, the name was PlayerController and public class was
Playercontroller : MonoBehaviour
this error was probably created when i created the file, and then renamed it, so if you rename a script, make sure to rename the class too.
That’s correct. Both MonoBehaviours and ScriptableObjects have the very strict requirement that the filename must match the class name exactly. Enums, structs, and classes that are not MonoBehaviour and ScriptableObjects do not have this requirement.