Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    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:
    210
    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:
    294
    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:
    210
    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:
    637
    The compatibility between UGUI and UI Toolkit Sort order was added only in 2021.2.
     
    Suduckgames likes this.
unityunity