Teleporting Player to a point using box colliders

I got some problem with teleporting my character to a certain point.

var TelePosition : Vector3;

function OnTriggerEnter(other : Collider) 
    if (other.tag == "Player") 
    transform.position = TelePosition;

// Box Collider Is Trigger must be checked to work.
// Change the transform.position coordinates in the Inspector.

This is the code i wrote. The idea is that if my player falls off the map and collide with the box collider, the player gets respawned or teleported to a different location that i have given with var TelePosition : Vector3;

Now the problem is that when collide, the Player don’t get teleported to that location. Instead the Box Collider decide it can teleport to that point.


*notice that i already tag my character with the tag : Player

So any idea what the problem is? I appriciate some help :slight_smile:

transform.position is the position of the object your script is attached to, which in this case is your box. Change it to other.transform.position = TelePosition and it will move the object that hits it instead (the player).