you can try to create a global script wich is always accesible and create a variable and store it the node there and then add a node that you get from there.
I think there should be a better way but this should work at least.
Ok, seems that actually it would be faster to create the node once again. For me at least, and my knowledge of scripts and autoloads…
Can you give this a try?
func clone(node: Node) -> Node:
var copy = node.duplicate()
# see https://docs.godotengine.org/en/3.1/classes/class_object.html#id2
var properties: Array = node.get_property_list()
var script_properties: Array = 
for prop in properties:
# see https://email@example.com#enum-globalscope-propertyusageflags
# basically here we are getting any of the user-defined script variables that exist, since those apparently don't
# get copied via `duplicate()`
if prop.usage & PROPERTY_USAGE_SCRIPT_VARIABLE == PROPERTY_USAGE_SCRIPT_VARIABLE:
for prop in script_properties:
I would suggest putting that in an autoloaded script (
Utils.gd or something) so that you can call it from anywhere like:
var friend_node = Utils.clone(lonely_node)
Apparently this is not what you were asking. If you just want to be able to duplicate a node in the editor, save the node you want to duplicate as its own scene. Then go to the scene you want it to be in, right-click the root node, select “Instance Child Scene”, and select the node/scene you want.
Erh… Where will the copy go into my other scene?
And you know, i’d like to clone it and use it, editin it as another node in my other scene, not havin it appear when loadin the game eh. Just like a duplicate, but in another scene.
Updated the answer
Eric Ellingson | 2020-02-10 16:12
Thxs, but that’s still a bit complicated, though i understand it. I’d prefer avoidin to create and instance new scenes just for duplicated nodes.
Well that is how it works in Godot
Eric Ellingson | 2020-02-12 01:24
Just wanna share if you want to delete the scene after duplicating the node:
after clicking “Instance Child Scene”, you can right click the instance → “make local” on both instance, then you can delete the scene
daniteer | 2020-04-22 12:20
True, that simple.
This is exactly what I needed.
vickera | 2021-06-04 01:47