Accuracy doesn't work. No enemies showing up.

Hello,

I am totally new to JavaScript and Unity. I’m making a simple game, watching step by step Tutorial of making it. I’m stuck at one problem. What I want to do, is to make accuracy and if it’s more than 60%, then next level and enemies are not showing up. But thing is, when I start game, no enemies aren’t showing up, at the beginning of game. Game is like a whack-a-mole type game, where need to punch. Here is code, how in Tutorial guy is writing and all is working:

#pragma strict

static var enemySpeed : float = 2;
static var enemyJumpSpeed : float = 2;

static var totalEnemies : int;
static var wave : int = -1;

var enemiesToSpawn : int;
var enemy : GameObject;

private var gameOver : boolean;
static var accuracy : float;
static var punchesHit : float;
static var punchesThrown : float;

function Update () {
	if (!gameOver) {
	accuracy = (punchesHit / punchesThrown) * 100;
	if (totalEnemies == 0) {
		LevelEndSequence();
		
		}
		}
}

function LevelEndSequence() {
	enemiesToSpawn += 1;
	wave += 1;
	totalEnemies = enemiesToSpawn;
	
	if (accuracy < 60) {
		gameOver = true;
	} else {
	yield WaitForSeconds(2);
	for (var a = 0; a < enemiesToSpawn; a++) {
		Instantiate(enemy, Vector3(Random.Range(3750,3755),-1.5,Random.Range(-2267,-2264) ), transform.rotation);
	}
	}
	
	punchesHit = 0;	
	punchesThrown = 0;
}

he has 2.5 Unity, I have 3.5 and nothing working for me. Game simulates, but no enemies at the begining are showing up.

If I don’t add:

if (accuracy < 60) {
    		gameOver = true;
    	} else {

, then, all work, but, of course, new enemies aren’t showing up. and no accuracy.

Thanks, alucardj for comment. Maybe you can give any solution for this? I attached picture, where you can see where I assign how many enemies to spawn, when I enter any amount in ‘‘Enemies To Spawn’’ field, they will change to +1, when game simulates.

Alucardj, full tutorial can’t be seen, I bought it, but I uploaded video, in where he does accuracy. I’m stuck in the midlle of video, where he writes code about accuracy. All is working for him, but not for me. Did all, like him before, till that video and part and all worked out, but not the accuracy.
I uploaded video here: Zippyshare.com - [now defunct] Free File Hosting

Please let me know, if you need any files or etc., from me, to get accuracy working. At the moment I’m stuck and can’t get work going and need this accuracy, to get end game function. I hope this video will help you to fix my problem.

Thanks, all, I really appreciate !!! Will try it. Thanks !!

function LevelEndSequence() {
enemiesToSpawn += 1;
wave += 1;
totalEnemies = enemiesToSpawn;
if (accuracy<1){
accuracy=100}
else
if (accuracy < 60) {
gameOver = true;
} else {
yield WaitForSeconds(2);
for (var a = 0; a < enemiesToSpawn; a++) {
Instantiate(enemy, Vector3(Random.Range(3750,3755),-1.5,Random.Range(-2267,-2264) ), transform.rotation);
}
}

    punchesHit = 0;    
    punchesThrown = 0;
}

I pretty sure it all because of your accuracy = 0 at the start. Add 2 line above "if (accuracy < 60) " should solve it.