I have a Green Tile prefab in Overworld scene that loads a separate Battle scene when the Player steps on it. It should save the Player’s position and boolean that it is stepped. When the Player wins the battle, you go back to the Overworld and the player should stay where he “stopped” and that Green Tile should stay “stepped on”. I also store most of my values in ScriptableObjects.
Here are the scripts from my Github repo:
https://github.com/IgorArnaut/SRC/blob/main/Assets/Scripts/Scriptable Objects/BoolValue.cs
https://github.com/IgorArnaut/SRC/blob/main/Assets/Scripts/Scriptable Objects/VectorValue.cs
https://github.com/IgorArnaut/SRC/blob/main/Assets/Scripts/Player/Player.cs
The thing is that I have multiple of these Green tiles and I want to do the process for each tile, one by one. I want to reset all ScriptableObjects when I every time I finish testing too. How I do that?
EDIT: I also want do this to one by one tile.
EDIT 2: Rephrased my sentences.
You can use static variables, you can simply save and load the game (hardware is definitely fast enough for that now), you can load the battle scene additive and disable gameobjects from the overworld, and probably other methods as well
If you JUST need to respawn the player at the same position, it probably is easiest to just have a static variable for the position which is read when starting the overworld scene
I agree with the above, and this is one of those questions that has a few hundred possible solutions. Static values, additive scene loading, and many other forms of data permanency.
I do wonder what/why you need all these BoolValue, etc, scriptable objects for. I know it seems like a good idea from that one particular Unite video, but it’s a trap to use these individual scriptable objects for absolutely everything. It’s an organisational nightmare at the very least and can potentially balloon into a performance one.
Consider using scriptable objects for collections of data, and ask yourself if you really need them here as well.