Search Unity

Level loading problem?

Discussion in 'Scripting' started by Sam_Pr, Jul 28, 2013.

  1. Sam_Pr

    Sam_Pr

    Joined:
    Aug 23, 2012
    Posts:
    66
    For some reason when I build my game and click play in the main menu it just freezes, and does nothing? When I do it in the editor it works just fine though. Any idea what my problem could be, and how to fix it?

    Also if you would like I have the code for the PLAY button in the main menu:
    Code (csharp):
    1. #pragma strict
    2. var PlayUp : Texture2D;
    3. var PlayDown : Texture2D;
    4. function Start () {
    5.  
    6. }
    7.  
    8. function OnMouseEnter () {
    9.  guiTexture.texture = PlayDown;
    10. }
    11.  
    12. function OnMouseExit () {
    13.  guiTexture.texture = PlayUp;
    14. }
    15.  
    16. function OnMouseDown () {
    17.   Application.LoadLevel("Island");
    18.  
    19. }
    P.S All the other buttons in the main menu work just fine.
     
  2. xniinja

    xniinja

    Joined:
    Mar 12, 2011
    Posts:
    230
    Make sure you have all of the levels you need included in the build. The code seems fine to me though.
     
  3. Sam_Pr

    Sam_Pr

    Joined:
    Aug 23, 2012
    Posts:
    66
    That shouldn't be the problem, it's in my build settings, and it works fine in-editor just not in the final build.
    $VeZ1RQp.png
    any other ideas? Anyone?

    EDIT: Just tried with another scene, and it worked just fine.
     
    Last edited: Jul 28, 2013