Level loads but nothing happens.

I hate to ask but I’ve spent hours and can’t figure it out because I don’t know why it’s not working let alone know how to fix it. I’ve done much searching and problem solving but of course it’s a lost cause.

I have enemies spawning in waves. When I defeat a certain number of waves it loads the next level and repeat the spawn waves. But it’s not repeating. No errors but nothing is happening in the scene. If the code is needed because of how unclear I’m being I’ll post it.

I’ve been working on something that sounds similar to what you are doing. Without seeing the code though, its hard to say what’s going on. Post what ya got and I’ll take a look at it. :slight_smile:

Are you loading a different scene, or are you loading the same scene. If it is the latter, try loading a different scene and then back again!

do all the scipts exist in that new scene ?

Are you using static variables? I find that most often when a levelLoad causes weirdness, it is caused by forgetting to reset static variables.

A level load does not reset statics variables, so you’ll have to manage this yourself if you use them.

When you load new level (unless you do LoadAdditive) your old level is destroyed, probably with your script that controls enemy waves. Try DontDestroyOnLoad function

You can also preserve thigns w/a combo of “do not destroy” flags and by taking advantage of the player prefs. (Built in functionality). Not sur how they all fit together drop by Pete’s tutorial series (free) – at http://www.burgzergarcade.com/

Look at these in specific::

  1. Unity3d Tutorial - PlayerPrefs 1/x
  2. Unity3d Tutorial - PlayerPrefs 2/x
  3. Unity3d Tutorial - PlayerPrefs 3/x
  4. Unity3d Tutorial - PlayerPrefs 4/x
  5. Unity3d Tutorial - PlayerPrefs 5/x
  6. Unity3d Tutorial - PlayerPrefs 6/x

Sorry, I didn’t realize anyone replied because it didn’t send me an email. But yes I reset the static variables. Yes it’s a different scene. And I shall try those suggestions. I will also look at those tutorials. Thank you.