oncollision spawnpoint transform using unet
im trying to make it so once ball hits ship ship transforms to object im having problems with the last part if ( curHealth <= 0 ) { curHealth = 0; transform.position = SpawnPoint.position; print ("hitdead"); anywayones help would be greatfully been bugging me for a while :)
pragma strict
var fullHealth : int = 100; var curHealth : int = 100; var SpawnPoint : Transform; var respawn : boolean = false;
function OnCollisionEnter(collision: Collision) {
if(collision.gameObject.tag == "Enemy"); curHealth -= 10; print ("hit"); }
function Update () {
if(curHealth >= fullHealth){ curHealth = fullHealth; }
if ( curHealth <= 0 ) { curHealth = 0; transform.position = SpawnPoint.position; print ("hitdead");
} }
function OnGUI() { GUI.Label (Rect (25, 40, 100, 20), "Health = "+curHealth); }