LoadLevel on collected pickups

Hello, new to programming and I’m trying to figure out how to load a win screen after the player has collected four pickups. It’s not generating any errors, but it won’t load the win scene after I pick up the four items.

Are we able to post our entire code on here? Or is that against a rule (sorry, new to the forum as well).

Currently I have a private int for the count and a void OnTriggerEnter. If the trigger has the player tag, then it increases the count by one. Next is “if (playSound)” (there’s a public AudioClip for it above the void), and then it checks if the count is greater than or equal to four. If it is, it goes on to the loadlevel script (something given to me).

Any help would be much appreciated, thanks.

Seeing that only the level loading does not work, what you could do is (when you want to switch to the “ScorePageScene”) call the function Application.LoadLevel("ScorePageScene");

The beauty about this is that it is a single line of code, but this won’t produce any fade in/ fade out effects when switching scenes. I assume that your level loader does additional things, such as this, and maybe even preserving the state of some desired objects… not sure, as I haven’t seen the code.

Here is Unity’s documentation for this function:
http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html

Hope this helps

Bilo