Question on set_focus_neighbor

Godot Version




Hi! I’m trying to set fs as top neighbor of vo via code; I tried everything but I can’t make it work :smiling_face_with_tear:
If someone can shed a light I’d be thankful :grin:

PS: neighbour doesn’t work, only neighbor

I’d suggest confirming that set/fs is a Control or (Control subclass), double checking your node paths, and making sure that you aren’t calling this from enter_tree, because at that point the onready stuff (anything with a $ in front of its name) isn’t accessible yet.

And actually, since you’re traversing the tree siblings like you do, it might help to put a one frame pause between ready() and actually trying to set this neighbor. Or call it deferred which i think would accomplish the same thing (not sure).

Basically ready is called when a node’s children are ready, but it’s unclear (to me) what the state of that node’s siblings would be at that point. Possibly undefined.