- Home /
Application.LoadLevel problem
My character collects "strawberries". My problem is that i want to load next level ( Application.LoadLevel ("Level2"); ) when it collects 5 "strawberries". I tried some ways but because i'm new i can't figure out the solution. I've put the Application.LoadLevel ("Level2"); where the green comment is, but it didn't work. Thank you in advance.
your Profile can be seen by clicking your name
you can accept answers on the the left side there's an thumbs up and thumbs down
and there's a check mark under it accept the answer with witch you've been most satisfied
more of the answers and Questions that is on the right
Answer by hrlarsen · Apr 07, 2013 at 07:04 PM
Have you added your scenes to your build settings?
go File > Build Settings and there you can click the "add current" from the different scenes of your game, then Application.LoadLevel() should work
can you reload the level you already are in? (Application.LoadLevel(Application.loadedLevel))
no.. still doesn't work.. i have a GUI code after the above one.. dose it matter?
Do you ever reach your condition? because it seems very strange that you cannot reload the level. Could you maybe also post your build settings?
function Update () {
if (strawberry == 5){
Application.LoadLevel (levelToLoad);
this is the solution i found it! :) i put it under a new function