function Update () {
}
var Health = 100;
function OnTriggerEnter(collision : Collider ) {
Health+= -10;
Destroy(collision.gameObject);
}
function OnGUI () {
GUI.Box (Rect (1,1,200,30), "Health: " + Health);
}
if(Health = 0){
transform.position.x = 0;
transform.position.y = 1;
transform.position.z = 0;
}
I think you can see what i am trying to do, When my health reaches “0” my position will be reset to the ‘Spawn’, only, it’s not working, i’m sure it’s a easy fix, Any help will be appreciated