Answer the question
In order to leave comments, you need to log in
How to make an invisible object visible and vice versa?
It is necessary for me that at pushing of the button, there was an object on a scene. So that when he clicks the button in the "Visibility" tab, the "Visible" option is turned off. Is it possible to do so? If so, how?
Answer the question
In order to leave comments, you need to log in
Get a reference to an object and pass a parameter to it.
var has_button_been_pressed = false
func _pressed():
var button = get_tree().get_root().get_node("Node/Button")
var panel = button.get_node("Panel")
if (panel.visible == true and has_button_been_pressed == true):
button.visible = false
else:
panel.visible = true
has_button_been_pressed = true
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question