0 votes

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.setaction_pressed,etc but none of them work
pls help

in Engine by (394 points)

2 Answers

0 votes

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 onButton_pressed():. In that function put your code for what you want to happen when that button is pressed.

by (39 points)
0 votes

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

by (14 points)
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.