using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class GameEndTrigger : MonoBehaviour
{

    public Transform playerTransform;

    public float triggerThreshold;


    private void Update()
    {
        if ((playerTransform.position - transform.position).magnitude <= triggerThreshold)
        {
            SceneManager.LoadScene(2); // load end scene
        }
    }
}
