Search Unity

Resolved How to make "always on top" UIDocument?

Discussion in 'UI Toolkit' started by Kichang-Kim, May 14, 2021.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    Hi. I have two UIDocument objects in scene, one is main UI and other is debug UI. I want to make debug UI is always shown on top of screen. So I changed Sort Order property of debug UI to higher value, but it still shown as random order. It seems that Sort Order does not work for multiple root UI documents. Is there any method that ordering root UIDocuments?
     
  2. pawelduda

    pawelduda

    Joined:
    Feb 1, 2019
    Posts:
    45
    Try using different Panel Setting for both UIDocuments. For the debug UI set higher Sort order in Panel Setting than in main UI.
     
    Kichang-Kim likes this.
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    I missed Sort Order in panel settings, Thanks.
     
  4. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    Hi! Indeed the Sort Order of UI Document only applies to UIDocuments with the same Panel Settings asset.

    If they did share the PanelSettings, then this sounds like a bug, the Sort Order on UIDocument should definitely allow you to keep one on top of the other.

    Thanks
     
    Last edited: May 14, 2021
  5. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    It can be easily reproduced. In my environment, if two UI Document shared same PanelSettings, Sort Order property in UI Document component does not work. But @pawelduda 's comment works for me (separating PanelSettings and set different Sort Order in PanelSettings)
     
  6. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    Edit: I incorrectly reported that I reproduced this issue in this post.

    I did not manage to reproduce this either on the mainline or with preview.14. Would you mind reporting this as a bug (Help > Submit a bug) so we can understand how to cause it ? Thanks
     
    Last edited: May 18, 2021