using UnityEngine; public class Teleport : MonoBehaviour { public GameObject toPoint; void OnTriggerEnter(Collider other) { if (other.tag == "Player") { other.transform.position = toPoint.transform.position; } } }