void Update ()
{
if (guiCreator.doneClicked == 1)
{
print (“I have detected the done”);
script.destination = target;
Vector3 spawnPosition = new Vector3 (0,0,0);
Quaternion spawnRotation = Quaternion.identity;
for (int i = 0; i < randomInstance.unitSend; i++)
{
print (“I am in the loop”);
Instantiate (policeCar, spawnPosition, spawnRotation);
randomInstance.unitCount–;
}
guiCreator.doneClicked = 0;
randomInstance.unitSend = 0;
print (“I am out of here”);
}
}
Basically when running it won’t execute the for loop. unitSend is never below 0 so that shouldn’t be the problem. I’m not getting any errors but it doesn’t print the message inside the loop. Am I declaring it incorrectly? Any help is appreciated, thanks.