Why is my _on_Card_pressed() signal not working but the function _pressed() is

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

Hi! I’m trying to make a card game. I currently have a Game scene and a Card scene (the cards are TextureButtons), and the Game scene instantiates some Cards. Now I want the cards to do something when pressed. A tutorial I followed uses func _pressed() and I put this in the Card’s script. When I use this to print something in the console and I click a card, it works. But when I try to use signals, it doesn’t print anything. When I try to configure the signal, it connects it to the script connected to the Card itself. So basically I have the following functions in the Card’s script:

func _pressed():
func _on_Card_pressed():

with the second function connected to a signal, but only ‘1’ gets printed out. What might be the problem here?

:bust_in_silhouette: Reply From: CassanovaWong

Have you tried running them one at a time? It could be the first function is consuming the event.