- Home /
Android port bug?
I've been working on a game called Coloration and I've been having some issues porting it to Android. I have a thing that fades into the next scene when you click but, whenever I do that, the game freezes for a couple seconds and then moves to the next scene. The fading works on all the other ports I've tested so I know my code isn't the issue here. I also played a game called OH MY FAT GUY which seemed to have this issue as well even though there was no scene fading. All it would do it stop all the animations and then switch to the next scene.
Is this a known bug? Is there any ways around it?
How do you load next scene?
You'd use Application.LoadLevelAsync or Application.LoadLevelAdditive
I just use Application.loadlevel();
However, I don't start loading the level until the fading is complete.
The fading routine is a coroutine? I think that you are sure that "Application.LoadLevel" is called at the end of fade/coroutine, right?
You may post some code/test package?
We're doveloping a game and we have no issues on mobile, regarding fading and changing scene.
We are using loadLevelAsync, by the way.
Answer by giulio-pierucci · Feb 10, 2015 at 03:33 PM
Ok:
First: (For performance reason!!) You shouldn't use camera.GetComponent on update method. Do it in Start and store in local variables. Use local variable in Update()
Second: Avoid GUI.DrawTexture (for performance), use DrawMesh or GL.Draw.
Third: FadeIn and FadeOut should be two coroutine. At the end of fadeOut you should call LoadLevel.
However, the instruction "alpha -= 1 * Time.deltaTime;" use 1 second to carry alpha from 1 to 0 and viceversa. If you invoke FADE after 0.5 sec. the fade will be incomplete. At least, call the method fade() after testing alpha level, or after 1 sec.
Everything works right on every other platform I've tested though. http://gamejolt.com/games/other/coloration/42526/