Godot Version
Version 4.3 stable official
Question
` I have a node called “GameManager” with a GDscript called “game_manager” that contains the function “subtract_life” as below:-
When I attempt to call the “subtract_life” function from a script called “killzone” I randomly get the error message “Attempt to call function ‘subtract_life’ in base ‘null instance’ on a null instance.”
Here is the code for the “killzone” script:-
I also tried to code the “killzone” script using a reference to the “GameManager” node as below, but the result was the same as seen below:-
Bear in mind that this appears to be totally random and the “killzone” script can work maybe once, twice or three times, but will then crash on the first “killzone” another time!
Any help greatly appreciated.