- Home /
LoadScene do not work well
Hi!
I am testing a plattform game. In a lot of devices run ok but in some phones or tablets, when i click "Start" in the main scene don't load good the next scene. When i click start, the game scene is superimposed on the main and does not look good.
The code it's this.. void CargarEscenaJuego(){ SceneManager.UnloadSceneAsync("Nivel0 - Inicio"); SceneManager.LoadScene (EscenaACargar, LoadSceneMode.Single); } Can anybody help me, please?
Thanks a lot!
Regards!
Please clean up that code by pasting it into a code block. Click the little icon that looks like 1's and 0's, then paste the code into the resulting box.
I run into the problem of Unity not moving the player to the next scene when I use single mode. Do you guys just have the player in every scene? I'm trying to figure this out...
Answer by MaxGuernseyIII · Sep 26, 2017 at 08:13 PM
It's really hard to guess what might be wrong from what you are telling us but, given the available information, I'll hazard one anyway.
I think maybe the fact that you are kicking off an asynchronous unload followed by a synchronous load could be the issue. When I tried code like that, I got a warning that unloading the last loaded scene was not supported. You're loading the new scene in Single mode.
Why not try just loading the new scene and let Unity worry about destroying the old one?
void CargarEscenaJuego()
{
SceneManager.LoadScene (EscenaACargar, LoadSceneMode.Single);
}
Answer by Pipioca · Sep 27, 2017 at 04:27 PM
Thank you MaxGuernseyIII!
In a first momento i has this code, only SceneManager.LoadScene (EscenaACargar, LoadSceneMode.Single) but it is the same.
don't appears on all devices but in some of them yes. It is an example:
Main scene:
And when i click START... The scene is frozen and the other appears in the background
Reallym thank you so much!
Your answer
