Trying to connect signal - signal is connected but isn't triggering func when emited

Hello prob a noob question but I’m pretty new. (a few months in now) Not sure if I’m overlooking something but I’ve connected several signals on this project but every time I try to do so on a control node script to a canvas layer script it wont trigger the function it is connected to. I checked to the node.is_connected() and it came back as true. Not sure why its not calling the func and passing the data. Not sure if custom signals work with control nodes? Any help would be greatly apricated.

The nodes are all being instanced if that makes a difference.

Your signal is declared without parameters. You emit the signal with parameters.
However I just tested this and it should work. Seems strange to me but it isn’t likely your issue.
I am guessing the code reaches the function and it is in there that either the for loop isn’t getting any children or the if statements are coming up false.
Put a breakpoint (or a print statement) on the first line of _load_copy_parse() function and see if it gets there.
I also don’t understand what you are doing with the double await statements or if either of them are even necessary.

1 Like

If is_connected() returns true then it is connected. Put a break point or print statement inside _load_copy_parse, at the top, before the for loops.

1 Like
  • Is the Block1 instance in the scene tree?
    • If the _ready haven’t called, it will not emit the signal.
  • What’s the _ready order when nodes are added to the scene?
    • When it emited the signal but the connection created after that, the trigger will not work.

From your code, I noticed that the call of _ready is before the connecting. Try to connect it before add it to the scene tree.

1 Like

@aawwaaa This was the issue! Thank you for your help!! Just moved all the code to a new func and had it run only if it was connected with node.is_connected if statement. and it runs wonderfully!! Thanks again!


@sancho2 Thank you for your reply! I didn’t know the signal itself could take parameters and was prob also part of my problem. Thank you!