Teleport

Im trying to teleport my player from point A to point B but seems that the action happens to fast. The player must be on the trigger of the teleport, so when I press the action button he teleports to the other spot. But this only works if I bumped really fast the action button, how can I implement a delay?

Heres the code

var destination : Transform;
var teleport=false;
var others;
function OnTriggerStay (other:Collider) { 
   if (other.CompareTag ("Player")) { 
   teleport=true;
   InteractionMax.interaction=true;
   others=other;
    } 
}
function OnTriggerExit(other:Collider){
if (other.CompareTag ("Player")) { 
   teleport=false;
   others=other;
    } 
}

function Update(){
if (teleport==true&Movementwii.fromWiimoteA==true)
      others.transform.position=destination.transform.position+Vector3(0,0.5,0);
}

Does anyone has a clue?

I’m not sure I understand the question; where do you want to insert a delay? Between the player entering the trigger and being able to press the teleport button? Between pressing the teleport button and the teleport happening? Somewhere else? Or do you just want to slow down the transition from the player’s start point to the teleport target point?

Oks sorry, I what to put a delay between teleportations, this is because the player seems no to move cuz the teleport is to fast and he returns to the first point.

If you can, detect the bool event “button pressed” instead of “button is being pressed”, because I suppose all your teleports have this script. Upon arrival, if your button is still pressed, well, you get your return ticket.