Search Unity

Official UI Update - Q3 2021

Discussion in 'UI Toolkit' started by benoitd_unity, Jul 9, 2021.

  1. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Hi everyone, time for another UI update!

    UI Toolkit in Unity 2021.2
    First off, we’re very excited to announce that UI Toolkit with runtime support is now available in the Unity 2021.2 beta release. This represents a significant milestone for UI Toolkit, which can now be used as an alternative for creating game and application UI. Check out this 2021.2 Feature Preview to learn more about what is included in the release.

    Big shout-out to everyone who helped us achieve this milestone, your feedback has been invaluable.

    How to get started
    You can get the latest beta from the Unity Hub or on our download page. Remember, the beta is not intended for use in production-stage projects. As always, be sure to back up your existing projects if you plan to use them with the beta.

    If you are currently using the package version of UI Toolkit, follow this guide to safely upgrade a project to Unity 2021.2.

    Public Roadmap
    You can follow the latest updates regarding the roadmap of UI Toolkit by visiting our new Unity Platform Roadmap, from which you can explore roadmap details and share your feedback directly with the product team.

    Cheers,
     
  2. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Grid Layout and Virtualized Grid Layout in List View'd be great for Q3
     
    NotaNaN, cfazilleau, Orimay and 4 others like this.
  3. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Where should we report beta bugs related to UI Toolkit, this forum or beta forum? (Besides reporting it via unity bug report)
     
  4. dujimache

    dujimache

    Joined:
    Dec 17, 2011
    Posts:
    89
    why uitoolkit doesn't use same font asset as TMP?? If we use both tmp and uitoolkit,there would be two fontasset in project.One normal fontAsset and one is TMP_fontAsset.This would generate two font atlas.
     
  5. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Noted, thanks for your feedback :)
     
  6. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    This forum is fine, just make sure to create a separate thread though please, it's easier to track them.
     
  7. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    Just wish I could finally dish the legacy UI and switch completely to the toolkit... but alas I need world space UI!

    Keep up the great work!

    PS. Should we expect to have up to date Unity-Learn tutorials / training specific for UITK when it hits production-ready? (I assume... 2021.2 LTS?)

    Thanks!
     
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @benoitd_unity. I didn't see any mention about UI toolkit dots runtime. Can I expect a UI toolkit dots runtime preview package release when dots compatible with Unity 2021.2?
     
  9. lucasshrew

    lucasshrew

    Joined:
    Jun 2, 2017
    Posts:
    1
    Are any plans to backporting UI Toolkit for current Unity LTS (2020.3.x)?
     
    Nintendo-Silence likes this.
  10. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    UI Toolkit for Editor UI is part of 2020.3, and you can use Runtime UI with the package.
     
  11. pawelduda

    pawelduda

    Joined:
    Feb 1, 2019
    Posts:
    45
    Any news when preview-15 will be available for 2021.1?
     
  12. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    World Space UI is such a critical matter for UIToolkit to be honest. I see that it is on the "Planned" section, I really hope that we can see something on that front soon enough :)
     
    NotaNaN, katemj, moo1210 and 7 others like this.
  13. Deleted User

    Deleted User

    Guest

    Interesting thing: setting element height in percents actually makes its height equal to 0.

    Steps to reproduce:
    1) Create a VisualElement with 100x100 px size and set the color to red:)
    2) Change width measurement units to % - everything's fine.
    3) Change height units to % - the element is still visible in UI Builder, but has 0 height in game.
     
    cfazilleau likes this.
  14. Midiphony-panda

    Midiphony-panda

    Joined:
    Feb 10, 2020
    Posts:
    243
    This is probably planned for Unity 2022, looking at the forum answers.

    In general, it would be nice to have more ETA on the product roadmap (something like "Planned for Unity 20XX.X" or "Planned no earlier than Unity 20XX.X").
    It would be easier for people to know if/how they want to use the framework :)
     
  15. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    Indeed! For example, we have a project that we want to ship by next year. There we have 100+ separate world space canvases, plus some screen space overlays and combinations of camera+ui->render target->ui raw image->camera.
    As can be imagined, overhead of ugui is heck. UIToolkit's "one batch" and high performance idea was charming, if it would have world space ui support ofc.
     
  16. Flying_Banana

    Flying_Banana

    Joined:
    Jun 19, 2019
    Posts:
    29
    This looks amazing! Would support for keyboard UI navigation be coming soon? Like selecting elements in code/by arrow keys?
     
  17. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    I'd love to be able to see and debug my Runtime UI in the Scene view

    Also, the documentation needs a lot of help. There are no examples and the only help is spread over random, years old demo videos.
     
    Last edited: Jul 19, 2021
    cfazilleau and KamilCSPS like this.
  18. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Yes, expect to see more updates about those as we get closer to the release.
     
  19. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    We have no updates regarding DOTS support unfortunately.
     
  20. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    This should be available soon.
     
  21. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Please create a separate thread when reporting issues
     
  22. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Yes you're right, but if we can't say with certitude in which version a feature will be released, we prefer remaining vague rather than committing to delivery dates we can't guarantee, and cause frustrations because you were relying on it.
     
    Midiphony-panda likes this.
  23. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Did you consider using UI Toolkit for overlay UI and UGUI for world space? May I ask what is your use case for world space?
     
  24. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Navigating the focus ring using a keyboard is already supported.
     
  25. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    What do you have in mind? An option to toggle displaying the UI on top of the scene for when interacting with the UI Debugger? Also feel free to post feature requests in the forum or in the new roadmap I linked, it's easier for us to track.
    Agreed. We're currently working on those and trying to make them available as soon as possible.
     
    Ofx360 likes this.
  26. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    Well, I have 100+ world space canvases and probably just one screen space at max. Tbh, the bottleneck on-screen space UI doesn't worth the effort of switching/learning UIToolkit.

    I have world space background images and text on world space canvases, they also tween and animate. I would say there are separate windows in a 3d space.
     
    Last edited: Jul 20, 2021
    itsarjunsinh likes this.
  27. Flying_Banana

    Flying_Banana

    Joined:
    Jun 19, 2019
    Posts:
    29
    Hmm, I couldn't find this anywhere, and I see that none of the Button or its superclasses implement ISelectable interface. I also couldn't find anything about specifying navigation explicitly, e.g. pressing down key while "Start Game" button is selected will select "Load Game", in the UI builder or in code. Does selection/navigation works differently than the currently uGUI?

    I did find a focus method, but that seems to deal with text input instead of navigation with keyboard.

    I'm happy to read any code if there isn't any documentation available yet :)
     
  28. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    I mean like UGUI's canvas with the Render mode set to either Screen Space Camera/Overlay. I'd really appreciate being able to see the UI in the scene view, in context of where i'm working (with the option to turn it off) - especially working on a 2D game. And a lot of the time i'll have the Game view "closed" (not the active tab), even while in play mode, so being able to debug the UI in the scene view would be nice.
     
    benoitd_unity likes this.
  29. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    @benoitd_unity We’ve brought this up multiple times on the forum, filed a bug report and repeatedly asked your team for help but the issue has been ignored for months, so I’ll try here.

    Text wrapping in UI Toolkit is completely broken and causes text to randomly wrap even when there is enough space. So a text such as “Start game” randomly gets split into two lines if text wrapping is enabled.

    I do not see how you can release UI Toolkit with this bug, or how you would expect developers to use the library in real world projects until that problem is solved. Text wrapping is a must in even the most basic games.

    The case number is 1332695 and the issue is also listed here:
    https://issuetracker.unity3d.com/is...tally-or-changing-the-match-in-panel-settings

    Does your team have any update on this?
     
  30. uMathieu

    uMathieu

    Unity Technologies

    Joined:
    Jun 6, 2017
    Posts:
    398
    @Flying_Banana The event system dispatches NavigationEvents to UIToolkit panels which will trigger Focus changes through focusable VisualElements. Tab-cycling can be controlled with the tabIndex property while Arrow/Gamepad focus cycling is currently handled automatically and uses the layout to change focus from one element to another.

    @oobartez A fix for this issue is in the works and is currently going through our verification process. It will unfortunately not be part of preview.15
     
    Tanner555 likes this.
  31. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    @benoitd_unity Is that the development of dots UI runtime has been stopped until this UI Toolkit out of beta at 2021.2?
     
  32. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    Is the 2021.2 beta the most up-to-date stream with preview 15 or are other release streams more up-to-date (LTS, 2021.1?)?
     
  33. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    I'm not sure if I understand your question, but I wanted to clarify that you don't use the UI Toolkit or the UI Builder packages with Unity 2021.2. You only need the packages with 2020.3 and 2021.1, and the more complete version is only in 2021.2 as we don't port everything over to the packages. If you need more information, please let us know :)
     
  34. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    No, thank you, that's what I needed to know :)
    > the more complete version is only in 2021.2

    Going deep into UITK integration in a risky move for a project, wanted to make sure I -always- got the latest and most compatible version of it... so 2021.2 it is!
     
    JuliaP_Unity likes this.
  35. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Sad that package is now compiled and source can't be changed anymore :(

    My ability to experiment dropped down to 0
     
    cfazilleau and zch1234qq like this.
  36. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @JuliaP_Unity @uMathieu Any special reason why can't ship it as built in package with source code?
     
  37. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    This thread gives some indication as to why we've had to stop adding new features through the UI Toolkit package:
    https://forum.unity.com/threads/ui-update-q1-2021.1043680/

    Being a built-in package wouldn't solve the main issue that being a core feature and a package at the same time represents too much overhead for our team.

    Can you elaborate on why that workflow was necessary for you ? Modifying package source to experiment is fine, but ultimately it does lead to a path where receiving updates and fixes from Unity is very hard.
     
  38. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    It also allows me to fix bugs without having to wait months for Unity to do it. For ex. default TextMeshPro package is unusable for me because of localized fonts issues and input field bug. Reported them but 2 months later they are still not fixed.

    Speaking of UI I've noticed that something very simple like drawing top bar of Game View takes a whopping 1ms, that's more than 20% of editor overhead in fullscreen playmode. Zoom slider (that i never use) alone takes 0.20ms...

    I'm very surprised that Game View is still not converted UI Toolkit.
     
    Last edited: Aug 12, 2021
  39. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Not really, I have a solution that replaces single files in packages. That with source control makes it very easy. I guess ill have to make another one for dlls with mono.cecil.

    Couldn't Unity have something like core packages? Or couldn't the package be available from package manager if someone wants source access?

    The more source users can access the better for everyone, there's nothing to hide as dlls can be decompiled easily. I already said couple of times that all packages should be on github but it's also true for compiled libraries:
     
  40. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    That's something that could definitely be considered.
     
    noobler, awesomedata and Kamyker like this.
  41. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    That's correct, DOTS support is not a priority for the moment.
     
    PutridEx and jGate99 like this.
  42. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    yes its better to first make it feature complete than adding dots
     
  43. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Indeed, don't bother connecting the DOTS. They won't lead you anywhere for at least a few years. ;P
     
    dannyalgorithmic likes this.
  44. Benjamin-M

    Benjamin-M

    Joined:
    Jan 17, 2015
    Posts:
    10
    In version 2021.2 UI Toolkit/ builder in Runtine will not support the new input system and visual scripting ?
    thanks
     
  45. JeddMorgan

    JeddMorgan

    Joined:
    May 15, 2018
    Posts:
    11
    The new default runtime theme ("Unity-theme://default") has broken some of my UI spacing and scaling, How can I revert to using the older default theme.
    Setting my theme to a blank TSS file completely breaks my UI, (nothing visibly renders)

    All I want is for it to work like it did in preview 14.
     
  46. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Sadly, that's why these are "preview" -- they aren't meant to be final (or built upon) -- since things _will_ change/break.


    That said...

    It could help the devs to show (visually) what "breaks" (and what doesn't) between versions. It could simply be an error.
     
  47. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    124
    Completely agree to JeddMorgan...
    Same issue here (using preview16). It seems not possible, to even see that default values. Its just referred to the ("Unity-theme://default"). Its a tss file, that seems a unity-asset with attributes, not even a uss file related, or viewable with something except the array view of unity...

    Other findings:
    Bug1: The height calculations are broken... Setting margin/padding on a text will cause wrong height calculations. The text is overlapping, and the height is reduced... I needed to wrap all my Label Objects to other ones.... Am i the only one who set paddings on Labels?

    Bug2: Unity Crashes when setting a "Focus" directly on instancing a InputField... It causes an index out of bounds... After long debugging into the horrible uncommented code: I found, that it needed to be rendered without a focus at least once, to fill the needed textinfo values...
    Workaround: Add a 100ms timer before calling "Focus"... (even 1ms delay is not helping)
    Simple usecase: Show a textfield and let the player directly start typing into it...

    Bug3: The Text inside of the InputField has very big margins. Looks pretty horrible now...

    Bug4: It looks like buttons now gets a focus and with WASD and Arrow-Keys can be moved around? Would be perfect to stay at a default behavior at default. :(
    The main Bug at it: It seems just happening in the compiled version, not in the Editor....
    Update: It looks it was just one of the compiles... No idea why it's now behaving normal again.

    Bug5: That mentioned Theme file is completely bad. Please split that in some basics and a uss files (including an "empty" basic one, that is just functioning, without useless not wanted style changes... Using a new created empty one causes that the root panel is not rendered well... Please no "Magic" /default stuff, so people have a chance to find something...


    If this "bugs" are not bugs, it would be good to mention that parts in the migration guide :)
     
    Last edited: Aug 28, 2021
    JeddMorgan likes this.
  48. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
  49. Neiyra

    Neiyra

    Joined:
    Apr 19, 2016
    Posts:
    28
    Hi, are there any plans to migrate ColorField from UnityEditor.UIElements to UnityEngine.UIElements?
    It would be very helpful if the ColorPicker logic would be available per default at runtime, too. :)
     
    awesomedata, Timboc and Ashfid like this.
  50. Ashfid

    Ashfid

    Joined:
    Jun 8, 2019
    Posts:
    20
    That and many other fields from UnityEditor.UIElements would really help too (to create fancy runtime tools)
     
    NotaNaN and awesomedata like this.