using System.Collections; using System.Collections.Generic; using UnityEngine; public class Teleport : MonoBehaviour { [SerializeField] private Vector3 destination; private void OnTriggerEnter(Collider other) { if(other.tag == "Player") { other.gameObject.GetComponent().enabled = false; other.gameObject.transform.position = destination; other.gameObject.GetComponent().enabled = true; } } }