Hello,
This is my first post on the forums. Hopefully I have this in the correct location.
I have a game that works in the editor, it loads my main menu, and I have a Play button that loads my scene.
When I build the game and run the .exe it loads, splash screen then main menu. When I hit the Play button, nothing happens, the button stays highlighted and no scene loads. I can’t click anything else it seems frozen and I have to force quit.
This is the code associated with my menu buttons.
using System;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public void Play()
{
Debug.Log("Play button pressed, loading first scene");
try
{
SceneManager.LoadSceneAsync("LevelOne");
}
catch (Exception e){
Debug.Log(e, this);
}
}
public void Quit()
{
Application.Quit();
}
}
My button’s handling in the editor is in the attached image.
And this is what I assume is the runtime log I found at
C:\Users\Me\AppData\LocalLow\DefaultCompany\GameX\Player.log
Mono path[0] = ‘V:/Unity/Gamex/dev/GameX_Data/Managed’
Mono config path = ‘V:/Unity/GameX/dev/MonoBleedingEdge/etc’
[Physics::Module] Initialized MultithreadedJobDispatcher with 11 workers.
Initialize engine version: 2023.2.15f1 (c5cbb0b314fa)
[Subsystems] Discovering subsystems at path V:/Unity/GameX/dev/GameX_Data/UnitySubsystems
GfxDevice: creating device client; kGfxThreadingModeThreaded
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce GTX 980 (ID=0x13c0)
Vendor: NVIDIA
VRAM: 4047 MB
Driver: 31.0.15.3623
Begin MonoManager ReloadAssembly
- Loaded All Assemblies, in 0.241 seconds
- Finished resetting the current domain, in 0.003 seconds
Initializing input.
Input initialized.
Initialized touch support.
UnloadTime: 2.478800 ms
Play button pressed, loading first scene
Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 9.847900 ms
Unloading 14 unused Assets to reduce memory usage. Loaded Objects now: 1253.
Total: 2.235200 ms (FindLiveObjects: 0.110000 ms CreateObjectMapping: 0.035400 ms MarkObjects: 1.902400 ms DeleteObjects: 0.187300 ms)
Some additional info - I had been working out of a 2020 version of the editor. When I went to add URP and 2D lights to my project, I ended up upgrading to 2023.2.15f1. All my build exe’s were working fine before I went down this path. I also tried building the game for Android and had this play button issue on the phone as well after I installed and ran the APK. So I switched back to Windows, Mac, Linux build in the editor. Not sure if that has anything to do with it, but I thought it worth mentioning.
I would like to be able to get some debug going so I can determine the problem; I don’t think my exception triggered which I was expecting. I am a complete Unity newbie, so any help anyone can provide would be much appreciated. Thank you
