0 votes

So, i have like a panel (patch9frame) which shows when the player enters an area
I want to control it from another script so i used get_node(path)
I accesed it with .and i wrote the show()keyword
Like get_node(path).show()
But i got an error
"Attempt to call function 'show' in base 'null instance' on a null instance."
Is there any other way i can show/hide a patch9frame?

in Engine by (402 points)

2 Answers

0 votes

Try get_node("path").show()

by (603 points)

tried, doesn't work
error :"Attempt to call function 'show' in base 'null instance' on a null instance."

Then like Zylann said your node path is incorrect.

Here are some example from the documentation.
http://docs.godotengine.org/en/stable/classes/class_node.html?highlight=get_node

You also can right click the node and select Copy Node Path, and paste it in your script.

enter image description here

0 votes

Also make sure your node path is correct. If you are unsure about an error in the debugger, have a look at the system console too, it sometimes contains more info ;)

by (28,733 points)

In the system console:
ERROR: Node not found: Player
In the debugger:
Node not found: Player

Yup, so the path is wrong, fix it :p

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.