How to remove a node with child objects from a scene, but not remove it from memory and a variable

Godot Version 4.1.1

I need to create a canvas scene from another node in the world for the game. In order for it to be created many times, I need to remove it from the player's canvas, but not remove it from the variable of the second node.

Question

How to do it? QueueFree doesn't help - it removes the node from memory and the scene.

reparent? I’m not sure I understand the situation fully.

You can remove a node from the tree, that will keep variables mostly-functional.

get_parent().remove_child(self)

I’m not sure what “the second node” is in this case.


maybe you need to use duplicate too?