Godot Version
4.3
Question
I’ve currently developed a system where the main way I create characters in my game is through scenes, so I can conveniently use the editor whenever possible.
So let’s say I have a Character Charlie, and Charlie has three orbs (red blue and green). These orbs can be used up and should be reset at a certain point.
So I have:
- Charlie (Scene of class Character)
- Red orb (Orb scene of class Orb, exported resource sets color to red)
- Blue orb (…)
- Green orb (…)
Now let’s say these orbs have been used up (queue_free()) or altered in some way (maybe blue has turned to purple through an item, etc.) and I want to reset to the initial state of the scene, is this possible?
in other words: I’ve stored the composition information in the scene tree itself, not in code, and I want to restore the initial composition of my nodes.
If I store the Scene just as a PackedScene, I don’t have the information which resource was used. Also as I understand there is no real way of “duplicating” a instanciated node, so I could save them as “initial_nodes” and put them in the tree later on.
Can someone help me in that regard?