Is it possible to change the location of child nodes using code?

Godot Version 4.3

Is it possible to change the location of child nodes using code?
For example:
was:
Control

Button1
Button2
Button3

after clicking on Button2:
Control

Button1
Button3
Button2

use the function move_child() on their parent

$Parent.move_child($Button3, 1)

the second argument is the position you want to move it to, starts from 0

1 Like