Application.LoadLevel when variable is a given amount

Hey, I’ve got an issue where I can’t seem to load a level in the game when a variable is a specified amount:

function CompleteGame(){	

		if (numSteam == "1"){ 
		Application.LoadLevel (2);
		} 
	}

Effectively, numSteam is the variable given to the amount of objects collected in the game, and when this reaches a certain amount, I would like another level to be loaded (“2” in the build settings).

Just to clarify, I have no previous coding or Unity experience before this project, so I don’t mind being ripped for posting a dumb question or something similar posted elsewhere! :razz:

Solved - I put the code in the function which accumulates the collectable icons, rather than it’s own function, seemed to do the trick :slight_smile: