How to access initial variable values?

Hi,

I need to get all “start” values of my GameObjects at runtime. The same when Unity loads a scene. This is needed for reseting the beginning state of a scene without reloading it completely. I hope theres a way to do this without saving all states by myself.
Thanks help and hinds…

Hey,

I would love to find a solution for this problem too.

The initial variable values are saved somewhere, how can I access them?

Kind regards

Johannes

If they are anythere … i would like to know that too.

greez

Unfortunately, you do have to store the values explicitly yourself - there isn’t anything in the API to retrieve the initial values.

not needfully.

you only have to store it if the object is in scene and the object is not an instance of a prefab.

if it is a prefab you can basically request the information again easily for example.

So how would I go “back in time”, e.g. if the Player dies and has to re-spawn at the last checkpoint, with all the enemies and states reseted?
(Use of Prefab-Values wouldn’t work for this case)

Is there anything like a “snapshot”-function?
Or do I have to implement features like that completely on my own (e.g. create a copy of all the objects and their values at the time of the checkpoint activation)?