using UnityEngine;

public class Cheakpoint : MonoBehaviour
{
    public Transform player;
    public Transform spawnPoint;
    public float spawnValue = 10f;

    void Update()
    {
        if (player.position.y < -spawnValue)
        {
            RespawnPlayer();
        }
    }

    void RespawnPlayer()
    {
        player.position = spawnPoint.position;
    }
}
