Make node a child of other node

Godot Version



i have a world node and its children are gun and player.
I want to make the gun a child of the player.
how do i do this

Just drag it onto the player node in the editor.

sry, i mean in code

Do you have bing?
I just type this in the editor:
godot code to move a node from one parent to another
bing gives the code:

func move_to_selected(node, old_parent):

thnx that worked. also, wdym i have bing? I dont have it

bing is the search engine for Microsoft Edge.

i see, so ur saying you found that with bing?

you can also use reparent

1 Like

Yeah, try it out. It’s really handy. Just type “godot code for …”