Loading screen on 5.3 (problem after loading the first scene)

So, I got a problem with my scene loader…

I can go from scene 1 to 0, or 0 to 1…but if I try to go from 0 to 1 and then go back to 0 it doesnt load(0 to 1 to 2 doesnt work eighter).

I made it based on this video:


here is the code:
http://pastebin.com/zp5ryD5r I

have few logs set, I only get response from “checkpoint 0”.

I also tried to pass the index value directly from the script:

public void Load_MainMenu()
{
sceneLoader.LoadLevel(0);
}

and this is the function I’m using to pass the value to the sceneloader:

public void Load_Level(int scene_id)
{
Debug.Log(scene_id);
sceneLoader.LoadLevel(scene_id);
}

Tried to make the scene loader a permanent object that doesnt get destroyed on load as well as a object that is generated on every scene and a object that is present on every scene.

any ideas?

Ok, so I did some research…

apperently, Unity derps sometimes with ‘waitforseconds’ and ends coroutine midway.

So, if anyone wants to use this code and is having the same problem just remove the waitforseconds and add a while if a counter on it to simulate a waitforseconds.