Unity GUI

Although I bought the license more than a year, but I am still new to Unity, I observe that people are asking a butter GUI system, so what exactly the problem in existing GUI? And why it is not recommend to use GUI in mobile project?

I hope they don’t replace the GUI system… I think Unity has one of the most powerful GUI systems I’ve ever used.

But it could be more efficient. A complex GUI can slow down a mobile device.

The biggest problems I’m aware of:

  • It’s slow.
  • It’s not WYSIWYG.
  • It may lack features.

It can be ‘WYSIWYG’, if used correctly with the editor.

what is WYSIWYG ?
and you experienced guys could you please help me on a problem.

  1. I want to move my character using GUI (left gui and right gui) in a 2d type game the problem is my character is not rotating 180 degree or you can say flips or turn in opposite direction like in mario. When i use the right arrow GUI to move my character in positive x direction its works fine but when i try to move in opposite direction( left side ) it slide the character not turn the character.
    What should i do to came out of the problem .

Mainly it’s performance issues that kill the OnGUI approach. It is easy to eat up a huge portion of your available draw calls on mobile devices with a relatively simple OnGUI based GUI (which is why almost nobody uses it during gameplay for iOS/Android). It’s also far from WYSIWYG - but that’s less of an issue (in my opinion).

FYI sushanta - WYSIWYG = What You See Is What You Get

thanks for the explanation KyleStaves, that was the answer for my 2nd Q. what about my 1st one ?

Unity GUI is has huge problems with overhead and performance on mobile devices; even on iPad a single GUI.Button( ) will prevent you from achieving more than 50fps and it only gets worse.

Additionally, Unity GUI’s response to touch screen is really lacking in similarity to native mobile controls and theres not much of a way to improve it without building custom GUI elements at which point theres no reason to continue using Unity GUI.

As for Unity GUI on PC’s and its flexibility/power - I use it all the time and I love it. Especially for building in-editor tools; I’ve never seen anything stronger.

I find it’s performing better then I expected on the iPad.

One of the games I’m prototyping has something like 70 GUI elements and I was surprised to discover that it still runs at 30 fps on iPad.

My biggest moans with the current GUI are -

  1. 1 Drawcall for each GUI element.
  2. Can’t use custom fonts properly (ie. bitmap ones) even though those work with the older GUIText.
  3. No visual tool, so it’s very scripting heavy.

It’s not that bad, but you quickly hit it’s limitations.

Thanks everyone for answer. What is the proper way to display 2D elements on mobile?

An orthographic camera with Depth Only works well if you need to build stuff from scratch :slight_smile:

Theres a couple plugins/scripts to make life really easy like SpriteManager and EZGUI (search the forums; easy to find lot sof threads about them)

What I want to display is health-bar, mini-map, score with custom fonts etc, what technique should I use on mobile?

Minimaps generally work out best as their own camera+layer mask

as for score, custom fonts, and a healthbar you probably won’t need many of the features of SpriteManager or EZGUI. If it were me i’d just make an orthographic camera and go to work :slight_smile:

You can use 3D Text to render your fonts easily enough.

No visual tool is the ain problem? still hopes will appear on 3.5 as mentioned in roadmap