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?