using UnityEngine;
using System.Collections;
public class Teleport : MonoBehaviour {
public GameObject otherPortal;
void Start () {
otherPortal = GameObject.FindGameObjectsWithTag (“portal”);
}
void Update () {
}
void OnTriggerEnter2D(Collider2D other) {
Debug.Log (“Hit the portal”);
if (other.tag == “Player”) {
other.transform.position = otherPortal.transform.position;
}
}
}