Load transform position

hey im pretty new in unity, and programming in general, so im sure its pretty easy what i want to know.
I have 2 scenes, 0 and 1 are the names, so, in the scene “0” i have a button that start the game, in the game (scene “1”) i have the bottoms save game, load game and main menu, so when i push save, the position get saved, and when i move and push load, the player back to the momment i pushed save, i want to know how i can save that position so if i go main menu, and push load game, i can back to the new position and i dont need to start the game all the time in the same place.
Hope someone can help me, thanks

If you just want the position to be stored within the same play session, you can cache the player position in a static variable in a script somewhere

public static Vector3 storedPos;
//maybe you want the rotation too?
public static Quaternion storedRotation;

If you are looking to store this information even between different play sessions, using PlayerPrefs will suffice for now, although most other games have their own save format to do this job I believe.

As Laperen mentioned, you have many options, a static class might be a quick solution but probably not the best long term solution. If you want a persistent saved position you might want to explore saving to a flat file in Json using the JsonUtility class which is fairly straight forward. You could also load a file through a www request or use c# classes to load/save files.

To get a prototype up and running the static method would work per game instance – it won’t be persistent each time you start and stop your game. PlayerPrefs is probably the quickest solution for a persistent save game feature. Good luck!