Hi All
I have a couple of scenes.
Scene 1 contains a few boxes which can be shot. These boxes (prototype enemies) have healthpoints and when shot their healthpoints decrease, they’re also moved by the impact (AddForce).
In this scene I also have a trigger which loads you to scene 2 when you stand on it.
Scene 2 is just an empty scene with the exception of a trigger which loads scene 1 again.
What I want to do is shoot some enemies / boxes to kill them, and move them around the level a bit - then enter the trigger to scene 2, then enter the trigger in scene 2 to go back to scene 1 and have the boxes in the same position as they were when I went to scene 2 (i.e. not in their default positions). I also want their healthpoints/status to persist.
I’m just wondering what the theory is behind doing something like this?
Would I have to store the position of each object in a static game control object (for example). Would I have to write a bit of code for every object? This would be ok for a few objects but could become unwieldy for a bigger game.
Would it be possible to get the position and healthpoints of all objects with a certain tag/layer when switching scene and store this data in a file which can be read when loading the scene again?
Any advice would be greatly appreciated. Thanks