Search Unity

(novice) I really don't understand how UI scale works in world space.

Discussion in 'UGUI & TextMesh Pro' started by AidanofVT, Sep 16, 2020.

  1. AidanofVT

    AidanofVT

    Joined:
    Nov 10, 2019
    Posts:
    104
    I'm trying to create a UI overlay for an entity in my game. Things in my test scene are on the scale of 1-10 Unity units.

    I create a world-space canvas under the game object; it's 100 by 100. No problem, I just resize it. I create a button subordinate to the canvas. It's 160 by 30. Resize to 5 x 5. Now it's super pixelated, as though the button is intended to be viewed from a much wider scale. After some fiddling, I fix that problem by reducing "Reference Pixels Per Unit" on the Canvas Scaler component. Not sure how that works, but it works. I try to change the text on the button. No text shows. On a hunch, I restore the button to it's original size, and the text is there. When I shrink the button, the text stays the same size and the button contains only white-space. This is 14pt font, which means that it should be 14 pixels high. But on what monitor?

    These 14pt letters would seem to be about ten unity units high. I can't set the text to 0.3pt size; that's ridiculous and Unity won't let me. Obviously, I'm failing to understand something very fundamental about scale in Unity. Would someone help me, please?