Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Mixing unity UI (uGUI) and UI Toolkit. Sorting order not working?

Discussion in 'UI Toolkit' started by Suduckgames, Aug 5, 2022.

  1. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    Hi there!

    We have a very big project in unity and we want to start using UI toolkit on runtime UI since it is easier for new UI artists that come from web development.

    We are trying to mix the rendering order of both systems since this is a must in order to use the UI Toolkit. We need to be able to render a UI Document behind another UI

    Right now we have lots of different canvas in our scene with the old UI system, this is the configuration

    upload_2022-8-5_12-41-9.png

    I am trying to render that canvas over the UI Document without success.

    I have tried to change the sort order of the UI Document along the sort order of the Panel Settings but none works

    We are not using sorting layers in this project

    Anyone has any clue if this can be achieved or how to do it?

    A way to do this is to use a render texture where we draw the UI, but this can have some performance issues, since we are also building for Web this can have scalability issues when drawing differents UIs

    P.D: I have tried this in a new project and it is not working either

    Using Unity 2020.3.34f1 with UI Toolkit 1.0.0-preview.18
     
    Last edited: Aug 5, 2022
  2. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    With uidocument sort order and Canvas set to Screen Space Overlay and a sort order it works fine.
    Maybe update to a newer Unity version?
     
  3. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    It is not easy to update to the new version. This project is quite big. We have 1 person trying to update to a newer version of Unity but there are lots of problems to fix before being able to update it.

    Can we use any specific version of preview working with that version?
     
  4. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    771
    The compatibility between UGUI and UI Toolkit Sort order was added only in 2021.2.
     
    Suduckgames likes this.