GUI or no GUI for mobile?

Hi,

I made a pause menu on top, right of the screen. I added a plane. On this plane I added a “Pause” texture. Now, when the user touches the pause menu (I check this with RaycastHit), I pause the game with:

Time.timeScale = 0;

I know, there is a GUI in unity. I don’t used the unity GUI, because I read somewhere, that is not good on mobile devices, because of the resolution. The GUI will be smaller or greater → depending on the resolution.

Is the solution that I first described good or bad? Is there a better solution?

Thx

OnGUI is not a good choice because of drawcall. Use sprites(unity’s 2D tools) with depth enabled second camera for GUI, or 3D mesh with depth enabled second camera.

A better solution is using a GUI framework optimized for mobiles and resolution independent: NoesisGUI 2.2 | GUI Tools | Unity Asset Store :slight_smile:

You can scale UnityGUI using ScaleAroundPivot.

Also check out this answer.

There’s nothing wrong with using GUIs on mobile. I used ALOT of GUI in my android game and it works great!

I think that your first solution is the long way of doing it. You should just have a GUI.Button :

function OnGUI(){
if(GUI.Button(Rect(0,0,100,50),"Pause")){
Time.timeScale = 0;
}
}