Search Unity

Help Wanted How can I have the UI scale to the camera viewport rect instead of the screen width and height?

Discussion in 'UI Toolkit' started by btsn, Sep 26, 2021.

  1. btsn

    btsn

    Joined:
    May 12, 2017
    Posts:
    6
    All of the panel settings seem to apply to screen dimensions. I also tried manually setting the panel.visualtree's style.width/height/left/top values manually, but this also didn't have the desired effect.
     
  2. btsn

    btsn

    Joined:
    May 12, 2017
    Posts:
    6
    Setting the visualTree's values didn't work, but I was able to set the rootVisualElement's values successfully.
     
unityunity