Author Topic: UI missing in Windows game, is visible in scene view  (Read 1187 times)

DMeville

  • Newbie
  • *
  • Posts: 3
UI missing in Windows game, is visible in scene view
« on: July 02, 2016, 11:50:44 AM »
Hello!  I've run into an issue that I can't seem to figure out what's going on.   Some of my TextMeshProUGUI Text has disappeared in the game view only, (it's visible in the scene view), and this only happens on Windows (OSX everything is working 100%)

I made a post about it on the unity forums here: http://forum.unity3d.com/threads/ui-missing-in-windows-game-is-visible-in-scene-view-is-visible-in-both-game-and-scene-view-on-osx.414876/#post-2704151 as I thought it was a unity bug (as other ui elements other than TMPUGUI text was missing), but it seems those other missing UI elements is due to a different problem that I've since fixed (Images don't like to use materials with shaders not from the UI category)

I hadn't noticed this problem before, and I've tested on windows before and all the text was there.  Earlier this week I downloaded the latest version of TMP from the asset store to see if it would fix a different bug I was having (World space text was visible through geometry), and it did, but it seems to have introduced this new text-disappearing issue.

It only seems to affect specific text components, as there's lots of other text (using TMP) even in the same canvas that doesn't disappear...

Any idea what could be causing this, and how I can fix it?!
Thanks!

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5578
Re: UI missing in Windows game, is visible in scene view
« Reply #1 on: July 02, 2016, 11:59:20 AM »
Any change you can get me access to the project or provide a Repro Scene that exhibits this issue?

Are you mixing normal TextMeshPro components with TextMeshProUGUI components in the scene? Are these two using the same font asset?

DMeville

  • Newbie
  • *
  • Posts: 3
Re: UI missing in Windows game, is visible in scene view
« Reply #2 on: July 02, 2016, 12:19:36 PM »
If you take a look at the video here at 20 seconds I load in a new scene.  This scene does have both TextMeshPro and TextMeshProUGUI components, and they both are using the same font asset.  The missing number on the clock at the top center is TextMeshProUGUI, and there is a big "1" behind it on the level geometry (which is very difficult to see).  It seems after I load this scene all the text starts disappearing though, as coming back to the main menu after this scene lots of text is missing.

I'll try and get you a reproduction scene, but it might take a few hours as I haven't been able to figure out exactly how to reproduce this issue of text disappearing!


Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5578
Re: UI missing in Windows game, is visible in scene view
« Reply #3 on: July 02, 2016, 12:25:09 PM »
Just for testing, use a different font asset or material preset on on the objects using the Mesh Renderer and let me know what happens.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5578
Re: UI missing in Windows game, is visible in scene view
« Reply #4 on: July 04, 2016, 02:21:34 PM »
This issue was related to using a mix of normal TMP text objects with TMP UGUI objects where these objects share the same Font Asset and Material Presets. Essentially, you have two systems (Mesh Renderer and Canvas system) fighting over control of the ZTest of the shared material as the Canvas set to Screenspace Overlay is trying to set this to "Always" whereas the Mesh Renderer in Worldspace using "LEqual".

The solution is to use a different Material Preset for each group of text objects. See the following video about "Creating and Working with Material Presets".