public GameObject player;
public Transform target;
private void Awake()
{
player = GameObject.FindWithTag("Player");
}
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.CompareTag("Player"))
{
Teleport();
Debug.Log("Teleporter Activatge");
}
}
private void Teleport()
{
player.transform.position = target.transform.position;
Debug.Log("Teleported");
}
This is all the code every thing works but not teleporting my player to target location.
Weird thing is all the debug.log act normal.