I have this script i have written to make the fire damage my player but it comes up with an error saying i need to swap the “=” (25,9) with a “:” instead but this leads to more problems please help!!!
var HealthAmount:int = 1 ;
var InFire:boolean = false;
var Interval:int = 1;
private var FPSInputController:GameObject;
function start ()
{
FPSInputController = GameObject.FindGameObjectWithTag("First Person Controller");
}
function Update ()
{
if(InFire)
{
HealthScript.Health -= HealthAmount;
yield WaitForSeconds (Interval);
}
}
function OnTriggerEnter(other:Collider)
{
if (other.GameObject == FPSInputController);
{
InFire=true
}
}
function OnTriggerExit(other:Collider)
{
if (other.GameObject == FPSInputController);
{
InFire=false
}
}