Search Unity

Resolved UI Toolkit Multi-display Almost Working

Discussion in 'UI Toolkit' started by JG-Denver, Aug 22, 2021.

  1. JG-Denver

    JG-Denver

    Joined:
    Jan 4, 2013
    Posts:
    77
    I am trying to get UIDocument to work with multiple displays with my project. It is almost there but has one major issue. In the Panel Settings, I have set the Target Display to "Display 2". It does then display to Display 2, but also to Display 1.

    Working with it further, it seems to not matter which Target Display you use, except when determining the size of the display area for the UI toolkit view.

    I am using:
    Unity 2020.3.16f1
    URP 10.6.0
    UI Toolkit 1.0.0 Preview 16

    I would rather not switch to a RenderTexture and have to manually wire that up.

    Is there another solution or fix coming that will resolve this? Do I need to upgrade my editor and project to 2021?

    Thank you in advance,

    Justin
     
  2. JG-Denver

    JG-Denver

    Joined:
    Jan 4, 2013
    Posts:
    77
    I upgraded to the project and editor to 2021.1.17f1 and this resolved the issue. Multi-display works great.

    There is one minor issue when rendering to a different display, the editor player will display "No camera rendering". You can hide this message in the player or put in a dummy camera to that display.

    Thank you,

    Justin
     
  3. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    @JG-Denver , are you talking about editor script only, or runtime as well? We are interested in using UIToolkit for multi display/multi window application for runtime.
     
  4. JG-Denver

    JG-Denver

    Joined:
    Jan 4, 2013
    Posts:
    77
    @Maverick , only in the editor and it is only a minor thing. Multi-display is working perfectly in runtime for me (there were some challenges in the past, but they are gone now). They will probably fix this at some point, but in the meantime, you can add a dummy camera to your scene on the same display and I just set the culling to a non-used layer which can just be disabled at non-editor runtime or removed for a build. The other possibility is to just turn off the warning in the editor player. Under the three dot menu you will see an option for the warning. It still displays the UI Toolkit output either way.