- Home /
I need my play button to load level 1 when the player touches the play button
I have develop an mobile game app that works perfectly fine on pc even on mobile the only problem that I am having with it on mobile is that the play button won't load level 1 and this is because of the code that is on line 6-10, I need to load level 1 when the player touches the play button. Please help I am so close to uploading my first app on the play store and really need to fix this small problem.
Thanks in advance :)
using UnityEngine; using System.Collections;
public class MainMenu : MonoBehaviour {
public string startLevel;
public void NewGame()
{
Application.LoadLevel (startLevel);
}
public void QuitGame()
{
Application.Quit ();
}
}
What is the value of startLevel
? Wouldn't you just set that to the name of your Level 1 scene?
And please highlight your code and use the 101010 button to format it properly.
Answer by AurimasBlazulionis · Jul 06, 2015 at 01:19 PM
Are you sure that you have added a scene in build options? Also if you have, then build a development build with script debugging enabled, keep your phone connected and it should show an error.
Answer by Omega2077 · Jul 06, 2015 at 05:30 PM
I have tried the development build with the script debugging enabled but it did absolutely nothing didn't help at all and I don't know what else it could be because the code in the time manager script, changes scenes when it hits 0, which works perfect on pc but does nothing on mobile and I cannot understand why this is happening.