Hey guys,
So i´m developing a Zombie wave survival game and i got an in-game shop, supposedly you can only access the in-game shop between rounds and on the start soo i developed a script to add and remove doors but obviously you get stuck inside if you don´t get teleported, for that i created a empty and placed a box collider that goes on all the in-game shop space and another empty has the teleport point the catch about this is that this is only enabled when doors are enabled as well. I´ve tried diferent ways such as onTriggerEnter, onTriggerStay, comparing the position of the player with the in-game shop one and teleport out. Nothing of these is working. And yes i ticked the isTrigger on the BoxCollider.
Current Code:
using UnityEngine;
using System.Collections;
public class tpOnTrigger : MonoBehaviour {
public GameObject teleportPoint;
public GameObject Player;
void onTriggerEnter (BoxCollider other) {
if (other.tag == "Player") {
Player.transform.position = teleportPoint.transform.position;
}
}
}