Is there a way to duplicate the current state of the node, and not the default one?
Like:
extends Node
var a = "default state"
Then you node.a = “current state” somewhere.
And then:
node.duplicate(69) #or something else
I need to get the “current state” instead of “default state”.
I googled, searched on this forum, and even asked an AI - the only thing I found was “Write your own function.”
Which is fine - it’s not a hard thing to do, but also kind of insane considering it’s such a common thing to do - just make a copy of a node. …And its children - yes.
It’s like if I was asked to write my own function for ‘==’.
I’m pretty sure the duplicate method does copy the current state of the node going by the docs for it. It duplicates all properties, signals, and groups from the one you call duplicate on.
As a slight aside, I wouldn’t trust a large language model AI for something like this; they’re just a really fancy autocomplete that only knows what an answer might look like not what the answer actually is. They all very often spit out an answer that looks like it might be right but is completely wrong.