I've not tested this but I think it should be something like this,
var destination : Transform;
var canTriggerTime : float;
function OnTriggerEnter(other : Collider) {
if(canTriggerTime == 0) {
//set the time to 10 seconds
canTriggerTime = 10;
other.transform.position = destination.position;
}
}
function Update() {
//check and stop trigger time from going less than zero.
if(canTriggerTime > 0) {
//subtract deltaTime from trigger time
canTriggerTime -= Time.deltaTime;
} else {
//set to zero to stop it from going below zero
canTriggerTime = 0;
}
}
I'm just learning myself and I also don't use UnityScript I use C# but I think it should be something like this.