help with player prefs

heyy everyone i have been trying to make a save load script but it just isn’t working.

here is the code i have if anyone can tell me what i am doing wrong i would much appreciate it.
#save script

function OnTriggerEnter (other : Collider)
{
	PlayerPrefs.SetFloat("X",transform.position.x);
	PlayerPrefs.SetFloat("Z",transform.position.z);
}

#load script

function OnTriggerEnter (other : Collider)
{
	PlayerPrefs.GetFloat("X");
	PlayerPrefs.GetFloat("Y");
	Application.LoadLevel(1);
}

with the load script i plan on having it as a button and not a trigger zone but this is just a test
and also if anyone knows how to make it load a scene through player prefs then that would be great ( what i mean is like it saves which scene im on in the save script and then loads that scene in the load script so then its just like when a player hits the load button it loads the level and position they were at.)

thanks for all the future help.

You’re not assigning the values from PlayerPrefs.GetFloat to anything.

–Eric

but i thought the set.float was meant to assign the value and the get.float was ment to get the value i set under the “key” name i gave it.

if that is not how you are ment to do it then how would i make this save load system??

Yes, but you have to assign the value you’re getting with GetFloat to something. Unity has no way of knowing what the value is supposed to be applied to unless you tell it. In this case, I guess you’d want transform.position since that’s what you’re using in SetFloat.

–Eric

ohhhh ok thanks a lot i get it now i will go work on the script thanks for all you’re help.