r/UnityHelp • • Jan 26 '23

New to Unity and have a UI issue

I'm not very experienced with Unity, but I do have two scenes that work fine when I'm in the Editor and click Play. But when I do a Build, my first Scene with 2 basic UI buttons on a menu does not work. It works fine in the editor but not on the build. I have to Ctrl+Alt+Del each time. Is there something minor I'm missing here? Or do you know if this is a code issue I need to debug?

It's a New 2D Project, the first button is to Play the game and just opens up Scene 2, and the second button is coded to Exit the Application.

2 Upvotes

1 comment sorted by

1

u/Author_JonRay Jan 27 '23

Well it took a whole night of tracking down issues and running tests. But I figured out what my problem was and I'm not sure how I got there, but I learned a few things were the cause of my issue. I had 2 scene, but had removed the MainCamera and EventSystem from Scene 0. So it was locking up without the EventSystem being there. Since I never really modified the EventSystem I duplicated the one I still had from Scene 1 and dragged it over to Scene 0. Once I compiled the build and ran it this time everything worked like a charm and the issue has been resolved. I also added a MainCamera to my Scene 0 just to be sure everything that normally defaults was there.