Rect in editor is different than android

Hello
I am having a hard time understanding how thr units are translated in device.

When I put GUI. Label and use a rect say with width and height equal to 100, then it looks on my editor great.

However when I run it on android device then the window (as well as the text) looks very small (as if it was set 20).

Why is this happening? Shouldn’t the units in unity be density independent. What is the proper way to do this

Thanks

Hey,

Maybe you can use Screen.width and Screen.height to scale your GUI elements according to the screen resolution ?

for a full screen GUI, something like this for exemple :

GUI.Box(Rect(0,0,Screen.width, Screen.height), "text");

However, I advice you to use the new Unity UI system instead of GUI, because it’s much more easier to use.

Here is some documentation and tutorials.

Good luck !