Search Unity

Resolution Scaling setting without UI

Discussion in 'Editor & General Support' started by tazerg, Oct 2, 2019.

  1. tazerg

    tazerg

    Joined:
    Oct 21, 2017
    Posts:
    15
    Hello!
    I use the Resolution Scaling setting in the Player Settings and Resolution Scaling Fixed DPI. But this setting affects not only the scale of the Game Objects but also the UI. How I can scale only Game Objects without Canvas Objects? I plan to use this in Android build.
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Attach a "Canvas Scaler" component to your canvas, then tweak the settings to your liking.
    https://docs.unity3d.com/Manual/script-CanvasScaler.html

    If you want the UI to adjust to the new screen shape/size without making the UI elements larger and smaller, you will want to use "constant pixel size" on the CanvasScaler, resize the canvas RectTransform width and height to fit your screen, and make clever use of RectTransform anchors for your UI elements.