The script that I have teleports the player from one object to another with collisions but I'm looking for it to be more like a gateway sort of like in portal where you could have one foot in one and the other foot out the other. Any help or code for this would be greatly appreciated.
using UnityEngine;
using System.Collections;
public class Portals : MonoBehaviour
{
public GameObject otherPortal;
void OnTriggerEnter (Collider other)
{
if(other.tag == "Player")
{
other.transform.position = otherPortal.transform.position + otherPortal.transform.forward * 2;
}
}
}
↧