Application.LoadLevel not working on iOS

I have created a script that handles all interface buttons.
This script handles navigation to new scenes and button press states etc.

When I test, with Unity Remote 3, I get no issues, but obviously, that runs on my desktop.
When I try to build for iOS, tapping the button will not switch scene.

Here is my Update() code:

	if(Time.time > delayedTime){

I have a fade out script on the camera, and this part just checks to see if the screen has fully faded (via a delayed time) and if it has, navigate to the next scene.

The targetSceneOrAction variable is a String which is public (allowing me to set it in the inspector for each button on an individual basis).

A Debug.Log of targetSceneOrAction reveals the correct string, and as mentioned, it works fine whilst testing within Unity.

On button press, the variable navigate is set and then the above function is accessible from the Update()

Are there any restrictions I need to be aware of when building for iOS.
At the moment, my app won’t navigate from the homescreen and it’s hugely inconvenient.
All in all, this script is one of the most simple processes in my app, there’s nothing hugely complex, so it’s kinda alarming that it’s not working…

Thanks in advance for any help you can offer!



With an indexed integer seems to work, though the very nature of the script is that anything can be passed to it to dynamically manage the scene switching. Is there any way I can do this through strings?


if (Input.touchCount>0)
    for(var t in Input.touches){
	    if(t.phase == TouchPhase.Began && guiTexture.HitTest(t.position))
         else if(t.phase == TouchPhase.Ended && guiTexture.HitTest(t.position))

My input detection works fine, both on build in iOS and in Unity Remote 3. ButtonTapped() switches the guitexture to a button down style state, and reset button switches it back.

It also wouldn’t be a mis-spell because it works in Unity Remote

You should give it as Application.LoadLevel("targetSceneOrAction"); or give it as Application.LoadLevel(1); and set the scene number to ‘1’ in the build settings of Unity.

How do you detect your “tap” ? Keep in mind that


won’t work on iPhone.
On other platforms Unity automatically performs a Raycast each frame to fire those events. For performance reasons this has been disabled on iPhone / mobile.

It would help to see your actual input detection…

If the Loadlevel is executed the only reason to fail would be that the scene isn’t part of your build (note if you misspelled the name it’s the same reason ;))