I am getting errors for some reason that has to do with my variables (gainmen) please help...
Here is my code:
function OnTriggerEnter (other : Collider) {
yield WaitForSeconds(1);
if(other.gameObject.name == "reachedtarget") {
if(other.gameObject.CompareTag(this.tag)) {
var mennum : waypointSoldier = other.GetComponent(waypointSoldier);
var gainmen = mennum.mencount;
count + gainmen;
}
else {
count - gainmen;
}
}
}
Thanks in advance.