using UnityEngine; public class TwoWayTeleport2D : MonoBehaviour { public GameObject toPoint; public float time = 0.1f; static bool pouse = false; void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player" && pouse == false) { pouse = true; other.transform.position = toPoint.transform.position; Invoke("F1", time); } } void F1() { pouse = false; } }