I have a script that needs to be used multiple times and it only works once. Im still a noob at scriping so please help.
HERES THE CODE:
**//this will be our "respawn point"
var startPosition : Transform;
//when it collides with the object (a portal or anything)
function OnTriggerEnter(theCollider : Collider)
{
if(theCollider.gameObject.tag == "Respawn")
{
HealthControl.LIVES -= 1;
}
//the object that collided (our player for example)
//will now have the same position in space as the "respawn point"
theCollider.transform.position = startPosition.position;
}
function Update (){**
Also heres the health script:
var heart1 : Texture2D; //One live left
var heart2 : Texture2D; //Two lives left
var heart3 : Texture2D; //Full health
static var LIVES = 3;
function Update ()
{
switch(LIVES)
{
case 3:
guiTexture.texture = heart1;
break;
case 2:
guiTexture.texture = heart3;
break;
case 1:
guiTexture.texture = heart2;
case 0:
//Game Over Script Here!
break;
}
}