Question by
KP0178 · Apr 06, 2021 at 07:41 PM ·
positionscenetransform.positiondatascene-switching
How do I find the Scene at which I saved my data in?
I've created a save and load system that works fine for just one scene, but when I save my data (position) in one scene and get to another it teleports me to that position just in the current scene. I've been looking around and couldn't find anything. I was hoping someone could help.
Comment
Given the sparse information I simply assume that you are saving the position into PlayerPrefs. If so, you should define the keys depending on the different scenes. Let´s say you save position with the key "POSITION":
you could rename the key to: "POSITION" + UnityEngine.SceneManagement.SceneManager.GetActiveScene().name
and load the saved value with the same scheme.