Hi,
I have created a menu and a game-world in separate scenes. On touch of Play on the Main Menu, I load the scene containing the game world, as follows:
Application.LoadLevel("Level1");
where Level1 is the name of the scene to be loaded. Before testing the two scenes in sequence, I loaded them separately on my iPhone, and they load and play successfully. But when I navigate to the Level1 scene from my MainMenu, on my iPhone, the iPhone just hangs for a while and then restarts. Could there be any specific reasons for this behavior.
I have to admit that my game world is rather heavy, but I am expecting that the Application.Load function would destroy the MainMenu scene before loading my game world. So, i think if the game-world loads successfully on its own, it should also load when navigating from the main menu.
Please advise.
Try loading a small, near-empty scene before going to the level1 scene.
Are both scenes in the scene list under “Build Settings”?
@Smag
I tried loading a scene with just my playable character, and it loads just fine from the Menu. But my actual scene doesn’t. I am concerned because the same scene (heavy one), loads just fine as an standalone scene.
@Tempest
Of course they are in the Build Settings. Unity would have shouted out a runtime error if it wasn’t.
No, I meant loading an empty level, which in turn loads your level1.
I tried that. Loaded an empty scene from the Menu and my Level1 from that scene. But still the same thing is happening while loading the World. The empty scene gets loaded and a blank screen shows, but it isn’t able to load the Level1 scene, and hangs for a while after which the iPhone crashes and restarts.
then your scene just is overfilled and can not work on the iphone.
the loading has to finish within something about 20 seconds or iphone os will terminate your application forcefully.
But the same scene works independently on iPhone (as I wrote several times). It loads fine if it is the first scene getting loaded.
I cleaned up my act and cut down the textures on my scene. Now it loads, but takes about 30 secs. I am working on optimizing it better. Thanks for all the help.