I'm my scripts it wont let me access a character at all. For example my small respawning script i plan on building on. Could someone help? But I am looking for a solution to accessing the game object variables which i never have learned. please help me if you can.
var mainCharacterHealth = 100;
var dead = false;
class health {
var dead = false;
function spawn ()
{
//if you are dead goto position
if (dead) {
gameObject.transform.position = Vector3(0,8,0);
}
}
function OnControllerColliderHit ( Hit : ControllerColliderHit )
{
//if you hit the designated object you will take 99 damage
if(hit.gameObject.transform)
{mainCharacterHealth -= 99;
}
}
}