How to get button press

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

i have 4 buttons and i want it so when any of them are press it will reset the game round
how can i do it
i have tried _pressed, pressed(), input.set_action_pressed,etc but none of them work
pls help

:bust_in_silhouette: Reply From: G392

You must select the Button node, go into the Node tab and connect its pressed signal to the node which has your script.

:bust_in_silhouette: Reply From: LockManipulator

Are you connecting it properly?

To connect it, make sure you have a script attached to your root node in the scene. Then you click the button node in the scene view, then go to the Node tab (next to Inspector tab), and then you click pressed(), then connect at the very bottom. Then you just click connect on the popup and in the script attached to the root node you should see a function func _on_Button_pressed():. In that function put your code for what you want to happen when that button is pressed.