I am making an arkanoid clone for learning. I have this line which appears to be called when I press escape, to leave the current scene and load the main menu:
if get_tree().get_nodes_in_group("balls").size() <= 1:
for ball in get_tree().get_nodes_in_group("balls"):
#do stuff here
I get the following error:
Attempt to call function 'get_nodes_in_group' in base 'null instance' on a null instance.
There are definitely ball/s on screen when I press escape. The code above is within a function called:
So I can't see even why the timer would be triggered and time out.
I'm a little confused. Can anyone see or think of anything that I'm missing?
Thanks so much....