"Attempt to call function 'popup_centered' in base 'null_instance' on a null instance"

This is the error I get when I walk into an area 2D node. I'd like it to show a popup.

I have a popup node as an Autoload, I have an area 2D with this code


func _on_Port_body_entered(body):
	$root/GUI.popup_centered()

Yeah, I'm dumb. I just had to add an empty script to the root node and then connect the Area2D there. Nothing to see here folks.

Although I gave up on the Autoload idea. That still doesn't work. I'm not sure if it's generally a good idea to have the most used interface on Autoload, maybe someone can tell.

2 years later