Hey, I was wondering why this doesn't work, can someone explain why?
button pressed signal
- Best Answerset by retroshark
In the docs for BaseButton
you can see that pressed
is a signal. What you want is probably button_pressed
property.
However, I generally recommend using signals and callbacks instead. Those are explained here
- Edited
gemmomoh Yo yo! As @LoipesMas mentioned, you are trying to reference a signal without attaching it. I would suggest reading up on signals in Godot. Once attached to the script you will be able to have the line print("pressed")
and it will work as intended.
Edit: Marking @LoipesMas reply as the best answer.
Thank you both for the explanation.