- Home /
New Unity UI not working with windows standalone builds
Hello guys,
I need help with the new UI system of unity.
Basically I created three sceens viz MainMenu, GamePlay and GameOver. Each scene has few ui elements like buttons and text. The main menu has three buttons Easy, Medium and Hard, when you click any one of the buttons, then you will be taken to GamePlay scene, where there is a text in the center which display which button was selected. And when you click Exit button in GamePlay scene, you will be taken to GameOver scene.
The entire set works within the unity editor, all the button interactions like hover, click etc. But when I export the game to windows standalone build, the MainMenu scene is completely static. Nothing happens when I rollover the mouse pointer on to the three button, the click event doesn't work as well to select difficulty.
I might be doing something wrong out here, but I don't know what it is? Could anyone please help me out on this, or share any insights with the same.
Regards,
When you are developing, are you using the dimensions that will be the same on your Standalone?
I mean are you not using Free Aspect or a wrong ratio? Also, are you sure you are anchoring the items so that whatever display ratio they are still showing right?
$$anonymous$$y advice, try a few ratio and see the results, it could be that your UI is out of the screen or get turn upside down due to the anchoring.
For instance, if you set the anchoring against the edges with a large ratio, when a smaller one is used, the distance between corners and anchors remains and then your quad is flipped (you then get a red cross in the scene but nothing shows on the game).
It's also possible that the stand-alone is throwing exceptions each frame because it's doing something that doesn't work outside the editor, like perfor$$anonymous$$g file-access on something that's only present in the project directory, or something. This could prevent control flow from reaching code that was supposed to handle the UI events.
Try taking a peek in the log file (output_log.txt) inside the [Application name]_Data folder, or building a debug build so you can see errors in red text in the stand-alone.
Thanks "Fafase" I will surely checkout with different aspect ratios. Thanks "CHPedersen" I will check the output_log.txt. Will post back my result here.
Thanks & Regards,
Guys first of all thank you for guiding me.
After quite few retries and hiccups I found that I was having more than one UI Canvases in the scene, and i was just disabling the UI cameras that rendered them, in this setup I gave each canvas a different camera.
So while toggling between them, I used to disable the camera and thus the previous ui entity was overlapping the one that was visible and hence the UI was not responding and hence the issue that I was facing.
Now I am disabling both the camera and UI canvas dependent on it and everything is working fine now. It took much time but was worth exploring, I very much appreciate for the help.
Thanks & Regards,
Your answer
Follow this Question
Related Questions
UI Only Updates As Intended When Editing Through Scene 0 Answers
4.6 UI Image follow mouse position? 4 Answers
4.6 UI shifts in final build (on PC only) 2 Answers
Need help converting a SelectionGrid to new UI 1 Answer
How to listen for UI Resize Events 3 Answers