Save Game

Ok i am making a project for school and i need to know how to save the game a check points and then be able to click continue at the main menu (shown in the picture) Does anyone know how to do that or no how i can find out?

It all depends on how complex the save data is. What I do in my (simple) games is to use PlayerPrefs. Think of PlayerPrefs as a class where you can store integer, floats and string variables and it stays saved between game sessions, even if you quit your game.

Let’s say that I had an int variable that stored my characters HP, simply named HP. What I would do is as follows (on my Quit function); PlayerPrefs.SetInt(“MyCharactersHP”, HP); In my Continue Game function and when restoring the game I would simply load it again by writing HP = PlayerPrefs.GetInt(“MyCharactersHP”);

Check out the functions here: Unity - Scripting API: PlayerPrefs

Hey thanks a lot but i can use it with two different scripts right?

it said HP unknown identifier

You would have to write
var HP:int = PlayerPrefs.GetInt(“MyCharactersHP”);

It’s just saying that HP is unknown because you haven’t declared it.

Oh wow that made me feel stupid hahaha. Now if I save the game will my character be in the same spot after and have completed all the tasks from last game?

You need to make sure you save either a variable to use as a checkpoint or the data used to decide the current area/state of the game. How you decide this is based on your needs and what you see as the simplest or best method. That way when you load the game it can decide what level to load and what has been done.

If your game is very linear you are likely to be able to get away with a checkpoint along with saving your inventory if you have one.