Hi, I want to teleport my player to a tactical insertion when the health is equal to 0 when the player hits a death barrier. But either it keeps teleporting my player to a position a bit away from the tactical insertion, or I keep falling under the map. So how do I make this work correctly? Here’s my script :
var TactScript : ThrowTact;
static var Health : float = 100.0f;
var DefSpawn : Vector3;
var TactSpawn : Transform;
function Start () {
}
function Update () {
if(Health == 0 && TactScript.HasTact == true){
transform.localPosition = DefSpawn;
Health = 100;
}
else
if(Health == 0 && TactScript.HasTact == false){
this.gameObject.transform.localPosition = TactSpawn.transform.position;
Health = 100;
}
}