Unity UI showing in Editor, but not in Build

I should start by saying that I am new to UI in general. Never touched the legacy GUI UI in Unity before.

I am using the new Canvas UI system. I have set the canvas to ‘Render Mode: Screen Space - Camera’ and linked the Main Camera to it. I have positioned Text elements to the Canvas and positioned them where I want. Everything looks good when I run in the editor; however, after building and running as a desktop/web app, the UI does not show up.

1 Like

I’m having the exact same issue. Some images in the UI are visible, but most such as text are not there when opening the build. Everything looks great inside Unity.

2 Likes

Okay, I figured it out for my case. In my case when in the build window (File > Build Settings), delete all the scenes, and re-add only the one you are building (you can re-add all your others too, after you confirm that this works). Since I was using imported library and some files from another directory it was pulling the incorrect scene. See if this works for you.

1 Like

I tried this, and it didn’t work. Having the same issue except that my buttons are showing up - just no text, and they are not clickable.

I was able to solve my issue by downloading the latest patch. Maybe this is your problem too?

1 Like

2018, this is still an issue.

6 Likes

I’ve never experienced this, and have used both the legacy UI system and the newer UI system for many years. Perhaps there is a problem with the particular version of unity you are using? I’d try and download a recent version (2017 or 2018) and see if the problem persists.

Also - perhaps the scaling of the UI is causing a problem where the UI is so tiny or so large its out of place… try adjusting the canvas to scale with screen size, matching either width or height, and do some testing to see if that helps.

[mention|UVq9IR+k6WfYxAjLxbTMGQ==], did you ever figure this out? I’m trying to help another guy who seems to have a similar problem.

I had a similar problem and found a workaround:

I noticed that when I manually resized the player window, the UI elements (buttons, in my case) would suddenly appear. So in script, after my UI is established as I want it, I change the screen resolution slightly, which causes the canvas to update correctly the same as if the user had resized the window. (Canvas.ForceUpdateCanvases wasn’t working.) Note that I’m running in windowed mode, so this just changes the size of the window - not sure what I would do if I was in fullscreen.

2 Likes

@geminiradio @JoeStrout @BiscuitJoe did you find a solution to this? Im having the same problem. UI elements all appear as desired if I change the resolution to something else and then back to my default (1080x1920). Main problem is on the built apk on android I can’t figure out how to resize the canvas and would not really want to.

I just stumbld upon this post while having a similar issue. My problem was that during setup, the Z-Order of one of my buttons was changed and the button was then rendered behind my background.

So double check the Pos Z of your hierarchy would be my best guess.

1 Like

Hello guys. I have a similar problem. Instead of UI elements, the water (water4advanced) doesnt appear in the build app. Do you have any clue on this?

I have the same problem. I have a background png image in the UI Canvas. It shows fine in unity but is invisible in IOS. The other gameobjects which are using the same material as background image show normally in IOS. Even the text in UI Canvas shows normally. I don’t why the bug for background image happens.

I have fixed my problem by using the image shader “UI/Default” rather than “Unity/Transparent”.

Fixed
First, save your scenes then go to (file > Build Settings) and check the right one that you need (don’t check the default scene) that worked for me

Struggled with this for literally 2 hours! After reading other people’s fixes, I FINALLY found the solution.

My problem:
My score UI would show fine within Unity editor with 4:3 aspect ratio. Same with title screen and game over screen. However, once I did a build and played the game, the score UI would disappear. Title screen and game over screen was fine. Frustrating! Almost gave up on Unity for the 58th time LOL!

What I tried:

  • Change the layout of the Canvas game object
  • Adjust sorting order
  • Change the font color
  • Remove all scenes from BUILD and add it back in
  • Research CS0649 errors to see if that had anything to do with it
    and then, finally!!!

When I realized my solution at the bottom was going to be the answer:
Changing aspect ratio from 4:3 to 800x600, I realized my score would disappear. That’s when it finally hit me!

Solution that worked for me:

  1. Resize text area with Rect Tool to make it bigger instead of perfect fit
  2. Within Text >> Inspector, change horizontal/vertical overflow to “Overflow” from “Wrap” so that if the text gets bigger than the designated area, it’ll still show up

Hope this helps someone! Don’t give up!! :slight_smile:

7 Likes

Hi all,
Having a similar kind of a problem:

I use an AR camera to display a model over a TargetImage. I have now implemented two buttons with which I can change between two models. All works perfect inside Unity but when building for iOS I can’t see either of the buttons.

Xcode does bring up some UI error (purple square) but haven’t been able to find out what is the problem there or if it is an actual error.

Any ideas what might the problem be? And to clarify: I’m a beginner in Unity and in coding so if it is not too much to ask, please be thorough in your replies :slight_smile:

EDIT: Aaaand now it works. Apparently deleting the scene from BUILD and adding it again worked.

Hi all,

I had a similar problem,

I could see all my UI elements in Unity but after build they just disappeared. After I manually changed the resolution they appeared but not all of them ( for example text was there only by 800x600 but textmeshpro till 1280x720). What worked for me I changed the canvas render mode to “World space” and now it shows my elements.

I hope it helps

3 Likes

Hi everyone,
I have the same issue here, I tried all the solutions proposed but no results
if anybody can help me plz

Hello everyone. I had very similar issue recently and none of the above solutions worked. In my case I had an UI element named the same way as different element was named and I was searching for the item by name. For some weird reason Windows in Unity Editor was fine with it, but cell phone just didn’t show up the UI. Thank you all for the help though and I hope I could help someone too.