0 votes

how i can (link) the button with something like score when i press it or point or anything like that and what the tools i need to do that and the script's

what there different in this case in 2D and 3D

and thank you

in Engine by (14 points)

2 Answers

0 votes

You need a Score node with a script. You button pressed event signal should be sent to you score node/script.

You can use signals of button. Name of signal is Pressed.
Signals is the general way to connect things.

The method is same for 2D and 3D.

by (313 points)
0 votes

I am not sure to understand what you are trying to do, but I know you can use the signals in your button node to check when it's pressed. Then in your function you can hide/show your score, add points or whatever you want to do.

This video might help you.

For example on how to write the simpliest code for a button, I have this on an "exit game" type of button :

extends Button

func _on_But_Exit_pressed():
by (36 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 Frequently asked questions and 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 [email protected] with your username.