Saving and Loading Scenes

I was wondering what type of variable could save an object’s position (such as a player object) in a scene, such that if the scene is exited and a new scene is loaded, then old scene is loaded again, the position of the saved object remains same as it was when the scene was exited.
Would this be a global variable, scene variable or object variable.
If it is, how would I carry out the action mentioned above.

Global. The others are deleted when the scene changes.

1 Like

Am guessing for the second condition when the left mouse button is released, I can just swap that out for the condition that I want to be fulfilled for the scene to change right??
Also would have to create a global variable for the player x and y position right??

Right

Variables do not need to be created to use them, but it is recommended.
It is also possible to save as global structure variables or in json format all values in just one variable. But that depends on which and how many things you want to save.

Does this have to be a string or a number global variable ?