i got my random battle generator working, now all i need is a way to save my character's position on one map so i can load a battle and fight, then after the battle resume exactly where he left off. like Final Fantasy VII's random encounters... i already know that it will have to do with vector3 and the character's transform data. but im not sure how i could keep track of that then use that information to respawn the character in that position.
answers that could help:
...thats about all i can think of that would really help actually...
if you can think of anything else that you think might help. please elaborate :)
I take your question to be 'how can I store data when loading a separate scene, then load the original scene again and access that data'. If that's not quite it, leave me a comment below.
To keep information between scenes, your easiest bet is probably to build some kind of 'backend' or 'scene controller' (call it what you will) that is generated once when you start up the game and follows the player around as they go to different scenes, keeping track of state information like their experience and what quests they have completed. You'll definitely need the dontDestroyOnLoad functionality. Pop your script in a gameObject in your Main Menu or Loading screen and fill it with info when the player selects 'Load' or 'Play'.
Further, I'd suggest making as many variables and functions static as possible, so you can call them without having to have a reference to a specific game object containing the script (using Find or whatnot). With static variables, you can access them with MyScriptName.varName (where MyScriptName corresponds to the C# class or the JS file name).
With that, your question becomes trivial: just before loading the other scene, load up your Vector3 myPositionBeforeFight (or whatever). Then, in an OnLevelWasLoaded call, restore the player to that position.