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: https://www.youtube.com/watch?v=oNf3gdjiEEQ
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?
Answer by ChrPunx · Jul 15, 2016 at 06:36 PM
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.
Your answer
Follow this Question
Related Questions
How to fix Loading Screen? 0 Answers
Passing Score from Game Scene to Game Over Scene usiing dontDestroyOnLoad C# 1 Answer
Unity 5.3 and Scene transitions, how to preload a scene before entering said scene 0 Answers
C# SceneManager script not loading next scene after (seconds) 4 Answers
Application.LoadLevel crashes unity 0 Answers