So I’m using an XML save/load script I found on the Wiki and I was wondering if there was anyway to edit it to work with multiple scenes
Here is the link to the script:
Thanks
So I’m using an XML save/load script I found on the Wiki and I was wondering if there was anyway to edit it to work with multiple scenes
Here is the link to the script:
Thanks
I wanted the same thing!!! Not a scripter!
Have you tried?
DontDestroyOnLoad(this);
I thing playerPrefs is the way to go, there real easy to use. Though rotations were a little tricky-lol
There is also some good examples on how to save Arrays in the wiki ![]()
How would I go about using PlayerPrefs?
Here is a sample of how to save position for a GameObject. I made it so you don’t have to have this script on object to be saved so you could construct a master script to put on a empty gameObject. I’m not a code JEDI yet so i hope the masters will also give some (easy)examples on saving as well. Cause i know there is an easier way there always is-lol
var yPosOffSet : float;//Offset y on load
var savedTForm00 : Transform;
var xcon00 : float;//convert the realtime pos
var ycon00 : float;
var zcon00 : float;
private var xPos000 : String = "xPos000";
private var yPos000 : String = "yPos000";
private var zPos000 : String = "zPos000";
var xPos00 : float;//The var that will be saved.
var yPos00 : float;
var zPos00 : float;
function SaveIt00(){///==SAVEIT==///
PlayerPrefs.SetFloat(xPos000, xPos00);
PlayerPrefs.SetFloat(yPos000, yPos00);
PlayerPrefs.SetFloat(zPos000, zPos00);
}
function LoadIt00(){///==LOADIT==///
xPos00 = PlayerPrefs.GetFloat(xPos000);
yPos00 = PlayerPrefs.GetFloat(yPos000);
zPos00 = PlayerPrefs.GetFloat(zPos000);
savedTForm00.transform.position = Vector3(xPos00, yPos00 + yPosOffSet, zPos00);
}
![]()
How do I get it to work? An I using it right? Im just placing it on a empty game object and then setting the “Saved Tform” variable to my player, but Im leaving the other variables at zero.
All you have to to now is call the function for save and then close your game and call the function for load
add this to the code
Untested
var autoLoad : boolean;
function Start() {
if(autpLoad==true) {
LoadIt00();
}
}
function Update() {
if(Input.GetKey("m")) {
SaveIt00;
}
if((Input.GetKey("b"))(autoLoad==false)) {
LoadIt00();
}
}
Well It looks right-lol ![]()
I fixed a small error ![]()

What do I fill in on these other variables?
You don’t fill in anything in on these vars cause they are to display the realtime movement and the convertion var that is insync with the pos vars the only reason i left them un Private was for testing so that you can see that when loaded the numbers jump to what was saved. After that i would make them private.
So when you hit play and move around the pos vars and the convert vars are moving with your players transform right?
When i made this script i made it to save 50 GameObjects and left one with exposed vars for testing. :idea:
OH, I see ![]()
Thanks for the help ![]()