Unity Objects are destroyed when I change a level, but not created again :P

Maybe this is a silly question, but I just noticed that Unity doesnt call Start() or awake on objects if you reload a level.

I have a level in a scene and a main menu in another, when I play I load the MainMenuScene then use Application.LoadLevel(1) to load the first level. When I lose Application.LoadLevel(0) is called. Then when I use Application.LoadLevel(1) again, the start function of all objects is ommited! even though all objects are suposedly created back since they are destroyed on load.

What can I do?

Ooops! sorry my bad, apparently some objects had DontDestroyOnLoad that causes this problem. Sorry.

Sounds like you found the problem, Consider using OnLevelWasLoaded on things that stick around between levels. It will be called after each level has been loaded.

Alternatively, take a look at PoolManager2, that will easily allow you to preload objects that don’t destroy across scenes. It saves on memory too when Spawning them (instead of instantiating them all the time). You use Despawn instead of Destroy.

Check out poolmanager2 here.