That’s odd…
I tested it and it works fine for me. I put together a control, a button and an option button.
Then a ready function:
And it works fine…
I mean, those buttons seem to be fixed. Wouldn’t it be better to have a reference already set up instead of searching by name every time you need them?
Yes, that is the reason.
If you dynamically create them, they’re not “owned” by the parent node.
Here’s an example, I created a new button and added it to the control.
get_children gives me the new button.
find_child doesn’t return the button
find_child with third parameter=false returns the button
get_node returns the button
Alternatively, if you REALLY want to use find_child, you need to also set the parent as owner (in my case, the control node) for it to work.
See the console, now all calls return the button.