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

public class holeTp : MonoBehaviour
{
    [SerializeField] private GameObject Player;
    [SerializeField] private Transform TpPos;
    [SerializeField] private GameObject PlatformHole;
    Vector3 PlayerTped = new Vector3();
    private float Timer = 3f;
    private bool trigger = false;
    private bool dontderpplz = true;
    private void Start()
    {
        PlayerTped = TpPos.position;
    }
    private void Update()
    {
        if (trigger)
        {
            if (Timer <= 0f && dontderpplz)
            {
                Player.transform.position = PlayerTped;
                PlatformHole.SetActive(true);
                dontderpplz = false;
            }
            else
            {
                Timer -= Time.deltaTime;
            }
        }
    }
    private void OnTriggerEnter(Collider other)
    {
        trigger = true;
    }
}