Hello!
I’m making simple location with first person view and I need access to second floor, thing is that the only way is through industrial ladder. I made a portal - simply bumping the ladder teleports you on second floor. Exit point is just emptyobject. But I can’t figure out how to match camera’s look with portal direction. Here is my little code and illustration, in case my English is awful.
using UnityEngine;
using System.Collections;
public class Teleport : MonoBehaviour { public Transform exit;
void OnTriggerEnter ( Collider other )
{if (other.tag == "Player")
other.transform.position = exit.transform.position;
other.transform.eulerAngles = exit.transform.eulerAngles;
}
}