How to save the spawnpoint to the checkpoint by restarting the scene?

I have a checkpoint script that transforms the spawnpoint to the checkpoint but when the player dies and the scene is restarted, the spawnpoint goes back to the beginning.
So I want that the spawnpoint should stay at the checkpoint, only when the player dies and the scene is restarted.

Checkpoint Script:

using UnityEngine;
    using System.Collections;
    
    public class Checkpoint : MonoBehaviour {
    
    	public string tag = "Player";
    	public HealthController controller;
    	public bool CheckpointActive = false;
    
    
    	void OnTriggerEnter2D(Collider2D other)
    	{
    		if (other.gameObject.tag == tag)
    		{
    			CheckpointActive = true;
    			controller.SpawnPoint.transform.localPosition = new Vector3 (1.8f,-2.8f);
    		}
    	}
    }

HealthController with spawnpoint:

    using UnityEngine;
    using System.Collections;
    
    public class HealthController : MonoBehaviour {
    	
    	public float currentHealth = 5;
    	public float lifePoints = 0;
    	public float DamageEffectPause = 0.2F;
    	public float deathDelay = 2;
    	public float respawnDelay = 1;
    	private string healthText = "Health";
    	private string lifePointsText = "LifePoint";
    	private string maxHealthText = "MaxHealth";
    
    	public GUIText guiLifePoint;
    
    	public Transform SpawnPoint;
    
    
    	// Use this for initialization
    	void Start () {
    		currentHealth = InventoryManager.inventory.GetItems (healthText);
    		lifePoints = InventoryManager.inventory.GetItems (lifePointsText);
    		transform.position = SpawnPoint.position;
    	}
    	
    	// Update is called once per frame
    	void Update () 
    	{
    		if (currentHealth > 0)
    			lifePoints = InventoryManager.inventory.GetItems (lifePointsText);
    
    		{
    			// Set the score text.
    			guiLifePoint.text = "LifePoints: " + lifePoints;
    		}
    	}
    	
    	void ApplyDamage(float damage) 
    	{
    		
    		if (currentHealth > 0)
    		{
    			
    			currentHealth -= damage;
    			
    			if (currentHealth < 0)
    				currentHealth = 0;
    			
    			if (currentHealth == 0)
    			{
    				
    				lifePoints -= 1;
    				
    				if (lifePoints <= 0)
    				{
    					StartCoroutine(GameOver(deathDelay));
    				}
    				else
    				{
    					StartCoroutine(RestartScene(respawnDelay));
    				}
    			}
    			else 
    			{
    				StartCoroutine(DamageEffect());
    				InventoryManager.inventory.SetItems (healthText, currentHealth);
    			}
    		}
    		
    	}
    	
    	IEnumerator RestartScene(float delay)
    	{
    		
    		yield return new WaitForSeconds (delay);
    		currentHealth = InventoryManager.inventory.GetItems (maxHealthText);
    		InventoryManager.inventory.SetItems (healthText, currentHealth);
    		InventoryManager.inventory.SetItems (lifePointsText, lifePoints);
    		Application.LoadLevel (Application.loadedLevel);
    	}
    	
    	IEnumerator GameOver(float delay)
    	{
    		yield return new WaitForSeconds (delay);
    		Application.LoadLevel (0);
    	}
    	
    	IEnumerator DamageEffect()
    	{
    		renderer.enabled = false;
    		yield return new WaitForSeconds(DamageEffectPause);
    		renderer.enabled = true;
    		yield return new WaitForSeconds(DamageEffectPause);
    		renderer.enabled = false;
    		yield return new WaitForSeconds(DamageEffectPause);
    		renderer.enabled = true;
    		yield return new WaitForSeconds(DamageEffectPause);
    		renderer.enabled = true;
    	}
    	
    	void OnGUI()
    	{
    		if (currentHealth <= 0 && lifePoints <= 0)
    			GUI.Label (new Rect ((Screen.width - 80) / 2, (Screen.height - 30) / 2, 80, 30), "GAME OVER");
    	}
    }

When

Application.LoadLevel (Application.loadedLevel);

is called, all of your information that is local to the scene is reinitialized. Your SpawnPoint will not persist. Your easiest way to solve this problem is to store the value in PlayerPrefs; just set floats for transform.position.x, .y and .z. However, PlayerPrefs exist between play sessions - this might not be ideal.

You’ll get more mileage by using DontDestroyOnLoad(). You could create a GameObject specifically to store data that you want persistent between scene loads, and in its Start() function you would say use the aformentioned function on the GameObject.