Toggle visibility with button

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By NeiPodam

I want to make a button that will toggle visibility of an panel. Is this possible with ‘User Interface’ scene and do i need to do some changes? If it’s not possible then what I can do similar to this?

:bust_in_silhouette: Reply From: Wakatta

Connect the pressed signal of the button.

func _on_button_pressed():
    $Panel.visible = !$Panel.visible

It’s working, thank you so much!

NeiPodam | 2021-05-14 07:35