I don’t think there is anything for duplicating an Object built-in to Godot, unfortunately. You might be able to make your own duplication code using get_property_list
and the get
and set
functions, but it might be slow. Something like this could, in theory, work:
# object_1 is the object we want to copy
var object_2 = object_1_class.new()
for property in object_1.get_property_list():
object_2.set(property[“name”], object_1.get(property[“name”])
I don’t know if it would work though.