I'm not sure if I'm doing something daft, if this is expected behaviour or a bug. I have a VBox container with two children which are spaced as expected by the VBox rules. At a certain point in the game I remove the second one with remove_child() and then create a new scene instance which I add to the VBox with add_child().
Yet the new node is just positioned at the top of the VBoxContainer rather than spaced after the margin container that should be in front of it. I tried moving the order with move_child(). I also tried adding multiple instances of the same new node as a test and they all end up piling on top of each other rather than end up spaced out in the VBox.
Can anyone think of anything daft I might be doing? Do I need to call something like re_jig_the_container_nodes() on the VBox after adding a new child via script?
I printed get_children() for the VBoxContainer and it is showing the two expected nodes, so not sure why it's not spacing them out the same way as when you set it up in the editor?