- Home /
save and load screen
hi, I was wondering if it is possible to make a save area in my game so that I can have a checkpoint and when you walk through it, the game will auto save. Then on the main menu I wanted a load game button that will load from that last checkpoint where you were.
I am not good at scripting at all so a link or the code would be great.
Also I wanted to make a collider with the trigger set to true for the checkpoints.
Thanks in advance
"also is posted in forums"
Answer by fherbst · Jun 11, 2010 at 11:44 AM
For the scene saving, have a look at this previous question:
http://answers.unity3d.com/questions/971/how-to-scrip-a-save-load-game-option
For the trigger -
Assign the following script to your gameObject:
var player:Collider;
function OnTriggerEnter(other:Collider) { Debug.Log(other.transform.name + " has touched the trigger"); if(other == player) { Debug.Log("It is the player!"); // Here you save your scene // SaveYourCheckpoint(); } }
For your load button, refer this.
(code is untested, but I think it should work)
Your answer
Follow this Question
Related Questions
Save and Load Questions 0 Answers
Null Reference Exception even after check 1 Answer
Create a terrain prefab? Saving a terrain? No? 1 Answer
nice Save but wrong load 0 Answers
Can't move after load saved game 0 Answers