Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Standalone UI click hard-locks game, but not in-editor.

Discussion in 'Editor & General Support' started by binbash3r, Dec 8, 2018.

  1. binbash3r

    binbash3r

    Joined:
    Nov 5, 2016
    Posts:
    10
    I've been trying to figure out why this is happening for two days now. I have some "Main Menu" code I run on my Title scene. It handles button presses and scene changes.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.SceneManagement;
    3.  
    4. public class MainMenuActions : MonoBehaviour
    5. {
    6.     public OptionsMenu optionsMenu;
    7.  
    8.     public void ChangeScene(int sceneid)
    9.     {
    10.         SceneManager.LoadScene(sceneid, LoadSceneMode.Single);
    11.     }
    12.  
    13.     public void Options()
    14.     {
    15.         if (optionsMenu.ShowOptions == false)
    16.         {
    17.             optionsMenu.ShowOptionsMenu();
    18.         }
    19.         else
    20.         {
    21.             return;
    22.         }
    23.     }
    24.  
    25.     public void ExitGame()
    26.     {
    27.         Application.Quit();
    28.     }
    29. }
    30.  
    31.  
    In editor, loading the scene works as intended. I am able to click buttons on the title screen and all the scenes load fine.
    When I build the project, clicking the button to "Create" hard-locks the game and there's no way out except to close it.

    No console errors in editor prior to building. No issues in the output log file in LocalLow. Double-checked buttons and confirmed that they are set to "Editor and Runtime". I have tried reimporting the entire project. I have removed the scene and created an entirely new one. Nothing has been working. Would this be a Unity bug? I'm currently on 2018.3.0b12 Personal. .Net runtime is 4.x and compatibility level is .NET 4.x with Mono scripting backend.

    I should also mention that there are no while loops or for loops in any of the code in this entire scene. There are only scripts set up to handle changing scenes and button presses.

    I have also recorded a video to show what is going on:
     
  2. binbash3r

    binbash3r

    Joined:
    Nov 5, 2016
    Posts:
    10
    As there's been no responses, I imagine this is a Unity bug.
     
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,624
    I highly doubt it, although it's possible. No one answered because you haven't described the most important thing: what are you doing in the code when you click the "create" menu?