Reparenting node via collider interaction.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Arkinum

Basically I have two nodes that are children of a plain node that makes up scene root.

if graber.is_colliding():
	if Input.is_action_just_pressed("ui_accept"):
		var grabItem = graber.get_collider().get_parent()
		print (grabItem)

I’m trying to get the node with the ray2D to make the node with an area2D it’s child with the press of a key. With the example above I manage to get a reference of the parent but no matter what code I try, I can’t seem to figure out how to re-parent the node.

Any advice is appreciated.