I have and odd error....
Here is my code:
function Attack (target : GameObject) {
var a = GameObject.Find ("MenCount1");
var textMesh : TextMesh = a.GetComponent(TextMesh);
print ("attacked");
count --;
textMesh.text = count.ToString ();
KillSoldier();
//attack the gameObject;
}
This function gets called when one of my objects collide with another. It seems to work well until I have 2 (or more) guys colliding the same object right after another. Then for some reason only the first decrementation works. Why is that?