Hello everyone,
I am trying to add checkpoints to my little game.
For that reason I tried to save all objects with a given tag
in my scene to a list and upon death wipe the scene of all objects
and instantiate the objects I saved in the list.
making an array with GameObject’s and filling it with FindObjectsWithTag
does not work here since when I destroy the game object in the scene
and try to instantiate it from the array, the object in the array will
try to access the destroyed object in order to rebuild it.
Basically i get that my list stores only references to the objects (right?).
But is there a way to store the actual objects in a variable so they can be
used for instantiating later on?
Instantiating a prefab would be a workaround but considering the parameters I would
have to save and reassign to each object,since all the objects are variations of a prefab, I am afraid it is by far not the best way to
tackle this problem.
thanks in advance,
- NeverGod