I’m using a script to move my player object between exterior/interior setpieces. I want to move the player from Trigger A to Trigger B, but offset Player position a few units on Trigger B’s Z axis so the player doesn’t arrive in the trigger. I’m not sure how to transform the local rotation of Trigger B into an offset in global space, though.
private GameObject Player;
public GameObject Destination;
// Use this for initialization
void Start ()
{
if (Player == null)
Player = GameObject.FindWithTag("Player");
}
void OnTriggerEnter(Collider other)
{
Player.transform.position = Destination.transform.position;
}