The ready() signal from my TabContainer is not working as expected. I know I can use the _ready() method, but I would like to know why the signal doesn’t work. My on_ready() function is never called. Does anyone know why?
This is what I think is happening:
Since “TabContainer” is a child of “Control”, it is set up first. So when the signal “ready” is connected in “TabContainer”._ready(), the node is already ready and the signal is not emitted anymore.
Do you really need to check if the node is ready in this case, since it’s ready before the node that verifies that is?
The child (your tab container) emits the ready signal before your parent _ready is called where you connect to the ready signal, but too late of course. That signal was sent and not collected anywhere and expired.
If your tab_container was connected via the inspector, it would work. But it is a bit dirty here to be honest and you could easily try to do things in that function before your _ready function is called.
I put a parent and child with a ready signal in the inspector and got this:
func _ready():
print("parent is ready")
func _on_canvas_layer_ready():
print("child node is ready")