How to unparent a node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HarryCourt
:warning: Old Version Published before Godot 3 was released.

I get this strange bug and it always sets whatever node I make into child of another node. How can I stop this feature?

The bug I am facing

:bust_in_silhouette: Reply From: YeOldeDM

What you’re seeing isn’t a bug, but just the way scene trees work in Godot.
Each scene can only have one base node. Every node you add to that will be a child of that, or a child of one of those children.

http://docs.godotengine.org/en/stable/learning/step_by_step/scenes_and_nodes.html goes over the basics of constructing a scene.

Creating instances — Godot Engine (stable) documentation in English goes over how to create more complex scenes by making a “scene made out of scenes”.

:bust_in_silhouette: Reply From: silinsar

Player is the root node of your scene and you can’t have multiple root nodes. If you want a different parent for your 2nd sprite create another root node and put Player and the 2nd sprite as children to that node.

:bust_in_silhouette: Reply From: lavaduder

If you don’t want a sprite to be apart of your current scene, You’ll need to make another scene. If you want them to interact, you’ll need to have another scene, (AKA a level/world scene). And instance the other 2 scenes in. In short you’ll be needing 3 scenes total.
world
–player (instanced in)
–otherthing (instanced in)

to instance in a scene click on the chainlink icon (it’s right next to the plus symbol(the one that adds nodes into your scene))

It’s how Godot’s node system works. It’s a good idea to look at the Godot Documentation when your stuck.