private void Start() { //the character handler is the component attached to our player healthHandler = GetComponent <CharHealthHandler>(); //if we have a save key called SpawnPoint if (PlayerPrefs.HasKey("SpawnPoint")) { //then our checkpoint is equal to the game object that is named after our save file //remember to get saves we use PlayerPrefs.GetString checkpointCurrent = GameObject.Find(PlayerPrefs.GetString("SpawnPoint")); //our transform.position is equal to that of the checkpoint transform.position = checkpointCurrent.transform.position; } }
// Use this for initialization void Start() { //must be attached to the player charStats = GetComponent <CharHealthHandler>(); }