- Edited
I'm writing an editor plugin where the user can click on one node, click an 'Upgrade' button and which then creates a new node with the upgrades and then inserts it into the scene tree. I would like the new node to be placed immediately after the node that was upgraded. I cannot find any methods that let you set the ordering of children in a node, though. Is there a way to do this?
Edit:
Okay, I just found Node.add_sibling() which will fix this particular case. But in general, is there any way I can add children at specific indices or change their order?