Idk why but this error was not there like yesterday or something but when I test it again today this error come up like wtf. Its say cant call methods on a null value but ITS not a null value, its was working well yesterday and now this?? wtf. Please help me with this.
So if the script is a global, then the @ready function is called before any other nodes in the scene tree are ready.
If you really have to do that (and I don’t know why you would be doing this) you should use a call to a setter function from the scene tree into the global.
BTW, classes are super handy. Have a read in the docs about custom classes. Perhaps this would be better in your case than a global script.
And here you can read about when autoloads are loaded (which affects the @onready for globals):
Without much more information like what your global is for, how you are calling it, what you are trying to achieve, the best answer I can give you is that a global @ready is called too early to reference a node in the tree. My advice, since you appear to be using this attached to yet another node (which is not what globals are used for) is that you might be looking for is to create a custom class, but who knows what you are trying to achieve here? Why is a script that is registered as global being attached to a node?
At least we know why your @ready is showing e as null. Which was the original question. And you have links to the docs about globals that explains why this is the case (for very good reasons I might add).
How about you reframe the question to something like, “I want to achieve this with this node in this script to do this but I don’t know how” and perhaps I can be of more help.
If anyone else can chime in here to help clarify this I would be grateful.