Last active
November 22, 2022 11:27
-
-
Save andrew-wilkes/cb1c1eedc100766a8a584c4bc925b615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var target = get_node("new_parent_node") | |
var source = get_node("child") | |
self.remove_child(source) | |
target.add_child(source) | |
source.set_owner(target) # I think that this line of code is only needed in Editor scripts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the move_child method to simply reposition a child node amongst its siblings.