1
\$\begingroup\$

In my level selection screen, all but the first level start out locked.

When I click on a level, it loads perfectly in Unity editor. However, when I build the game on a real device, the game stops as though I had pressed the back button on my device instead of launching the level.

What happened? How can I debug this, given it works fine in the editor?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Are your levels different scenes? \$\endgroup\$
    – House
    Commented Apr 14, 2014 at 13:43
  • \$\begingroup\$ Yes they are different scenes ! \$\endgroup\$ Commented Apr 14, 2014 at 13:44
  • \$\begingroup\$ Make sure you don't have any exceptions being thrown in the editor. Also check out this: klonk-games.de/2013/11/tips-android-development \$\endgroup\$
    – Tetrad
    Commented Apr 14, 2014 at 16:30

1 Answer 1

3
\$\begingroup\$

When building your game, Unity will not include all the scenes by default. Ensure that your scene is included and checked in the build window. The build settings window appears after selecting build and displays the currently selected scenes to be built. You can also find it by selecting File->Build Settings. You may need to add the scenes yourself and then ensure they're checked to be included in the build.

\$\endgroup\$
8
  • \$\begingroup\$ Every scene is included. I have double checked that. If that the case unity won't be able to run everything fine in the editor (From splash to end Scene). All 16 scenes are included. It's even running fine in PC & Mac Build but for android it's just stops, Same as If I tapped the back key. :( :( \$\endgroup\$ Commented Apr 14, 2014 at 13:59
  • 1
    \$\begingroup\$ OK, then you need to provide more information about how you're switching scenes, what kind of debugging you've done and so on. You'd help yourself a lot if you caught exceptions and wrote them to a log file. Right now, it's likely just failing horribly and ending the app. \$\endgroup\$
    – House
    Commented Apr 14, 2014 at 14:05
  • \$\begingroup\$ Just as I mentioned that I am selecting scenes from my menu scene. When I click or tap on screen. Through RaycastHit I got the collider and after checking it's name I load my level with Application.LoadLevel(<Level Name - Whatever it is>); The main problem is that it works fine from editor, In PC & MAC Builds but for android it's getting touches but not loading \$\endgroup\$ Commented Apr 14, 2014 at 14:12
  • 2
    \$\begingroup\$ That's not a question to be addressed in the comments. Ask a new question. \$\endgroup\$
    – House
    Commented Apr 14, 2014 at 14:20
  • 1
    \$\begingroup\$ Developers ARE voluntarily helping you by answering your question on this site. \$\endgroup\$
    – Almo
    Commented Apr 14, 2014 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .