Unity 2018.1.3f1 UI flickering issue

Viewed 1809

Our team has been experiencing UI flickering issues since we've updated our Unity version from Unity 5.4.3f1 to Unity 2018.1.3f1. It only appears on the build (Android/iOS) but the flickering doesn't occur on the editor. Note: Our UI's layering is already setup.

Things that we've tried but didn't work:

  • Changed the main camera's transparencySortMode from default to Orthographic.
  • Turning on/off the canvas component instead of the GameObject itself.
  • Added some value on z-axis of the prefab (ex. 0.05, 0.1, 1, etc.)

Do anyone experience this kind of issue? If so, please tell us your fix (or possible fix) for this kind of issue. Any answer would be much appreciated.

2 Answers

Did you try instantiating the UI, slower for example you can test it out using coroutine. So instead of instantiating the UI in one frame for example in one function why not try using coroutines.

IEnumerator PrepareUI()
{
   //Instantiate UI - 1
   yield return new WaitForEndOfFrame();
   //Instantiate UI - 2
   yield return new WaitForEndOfFrame();
}

This worked for me before I experimented with it instead of end of frame on some areas I ended up with WaitForSeconds(float) and that showed significant improvement.

I had the same problem. Make sure you update UI only when it needs to be so don't put any code on Update() and change UI elements only on events. For example if you have score value don't set scoreUI.text = score in the Update function instead you can make a property that updates the scoreUI if score is changed. your problem probably is that you Activate or Deactivate UI elements on Update() so find another way to do it.

Related