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. Dismiss Notice

Official UI Toolkit 1.0-preview available

Discussion in 'UI Toolkit' started by benoitd_unity, Jul 8, 2020.

  1. jonjojo

    jonjojo

    Joined:
    Jul 29, 2014
    Posts:
    16
    I wrote an equivalent system using DOTS for all the calculations, managed to get it running super fast. Can't remember how I actually rendered the health bar but that wasn't really the bottleneck
     
  2. tatsuuuuuuu

    tatsuuuuuuu

    Joined:
    May 12, 2020
    Posts:
    36
    Hi, I'm using linux vulkan HDRP,

    in the UI Builder window I get a message saying :

    > Your project is not configured to support UI toolkit Runtime UI, to enable runtime support, install the UI toolkit package.

    and it's link takes me here.

    what am I missing? I have UI builder installed I also have the UIERuntime folder from the github demo repo in my Assets folder. there is no "UI Toolkit" package in the package manager even with preview packages enabled. what exactly is it asking for?

    EDIT : oh ok you have to do this : https://docs.unity3d.com/2020.1/Documentation/Manual/UITK-package.html
     
    ahcollin likes this.
  3. tatsuuuuuuu

    tatsuuuuuuu

    Joined:
    May 12, 2020
    Posts:
    36
    I'm trying to use the new setup as instructed AKA not Panel Renderer but UIDocument.
    I set UIDocument's Source Asset to my UXML, (Panel Settings was already set to the Panel Settings script)

    I have a black background Visual Element that I made flex 1, In the preview it covers everything but when I run nothing shows up.

    Am I supposed to tweak Panel Settings settings? what am I missing?
     
  4. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Hello, I can't tell what's wrong from what you're describing here, but it does sound like it should work. Have you checked what the UI Toolkit Debugger shows for it? Look for the Panel Settings entry on the top left list.

    I recommend you start your own thread about this, though, as if there is an issue it could take some back and forth to get to it and we should keep this thread focused on its original subject ;)
     
  5. tatsuuuuuuu

    tatsuuuuuuu

    Joined:
    May 12, 2020
    Posts:
    36
    I made a new question thread here : https://forum.unity.com/threads/trying-to-use-ui-toolkit-nothing-shows-up.966275/
     
  6. MoruganKodi

    MoruganKodi

    Joined:
    Feb 11, 2015
    Posts:
    66
    OK. So I am trying this out, but now how construct construct a UI entirely procedurally using UIDocument?, because as far as I can see, the rootVisualElement is no longer writable. I want procedurally generate some UI at runtime. I could previously pull this off with the old PanelRenderer.

    I explicitly want to be able to generate runtime UI without having to manually create a VisualTreeAsset, I cannot see any way to manually set and define the root procedurally.
     
    Nexer8 likes this.
  7. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    You can grab the rootVisualElement of the UIDocument and add however many other VisualElements to it from a separate MonoBehaviour. Just make sure to do it on your implementation of OnEnable (or somewhere called by it) and the root will be ready for you.

    Given that you won't be setting an UXML to your UIDocument, your root will be empty.


    Hope that helps!
     
    JoNax97 likes this.
  8. MoruganKodi

    MoruganKodi

    Joined:
    Feb 11, 2015
    Posts:
    66
    Actuall nevermind. I used to simply replace root element with PanelRenderer.




    Edit: yeah - just realized that, but the docs may need somewhat clearer language to imply the rootVisualElement is not null.
     
  9. Nexer8

    Nexer8

    Joined:
    Dec 10, 2017
    Posts:
    271
    Is there/ will there be a way to show the visual elements in the scene view, kind of like how the canvas works? I’m developing some tools, and the lack of scene view visualisation makes the tool a lot less useful. Also, are there any code examples with some explanation somewhere?
     
  10. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Hi @Xenerade , there's a preview of the UI in the Game View, and the UI Builder provides the authoring experience similar to UGUI on the Scene View - have you checked it out?

    As for examples and explanations, we're maintaining this demo project for this purpose, it will get updated every now and then as new features are available: https://github.com/Unity-Technologies/UIToolkitUnityRoyaleRuntimeDemo
     
  11. caseyc

    caseyc

    Joined:
    Jul 2, 2012
    Posts:
    18
    I have a UI setup that is currently working with the old input system. This morning I tried switching to the new input system so I could better detect when events had been consumed by the UI and not pass them through to my game. Upon upgrading however, I found that the mouse position doesn't seem to be updating correctly. When hovering different elements they flicker constantly as if the position is sometimes not where the mouse is. I have an element at the center of the screen and that seems to flicker too even when not hovered, so it seems like sometimes the Point action might be thinking the mouse coordinate is (0, 0) even when that isn't the case. I'm on unity 2020.1.3 and have the latest Input and UI Toolkit packages. I tried making my own input actions, I also tried using the UIToolkitInputActions included in the package to make sure it wasn't something wrong with the setup, but they both have the same problem. I also tried turning the repeat delay and rate to 0, I know that shouldn't affect pointer position but I tried anyway. Has anyone got this working and is there something else I should try? Thanks!
     
  12. Nexer8

    Nexer8

    Joined:
    Dec 10, 2017
    Posts:
    271
    Yes, I know about the Game View visualization and the UI Builder. The reason I need it for the Scene View is because that is where I can draw buttons and tools. The tool is for procedural/user predefined UI using the UI Toolkit, and having to switch between Scene View and Game View is counter productive. Alternatively, is there a way to draw buttons in the game view instead, or just render a Visual Tree to a texture displayed in the scene view? Modifying the UI Builder does not seem like an option here.

    Also thanks for the examples, will look into it and learn from them.
     
  13. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    cultureulterior likes this.
  14. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    732
    This looks very similar to this issue: https://issuetracker.unity3d.com/issues/flickering-hover-state-in-listview-using-new-input-system
    We're working on it and hope to release a fix shortly.
     
  15. oxybaka

    oxybaka

    Joined:
    Sep 18, 2017
    Posts:
    1
    Why doesn't vertical cursor key work in this example? (Navigating the menu with up/down keys)
     
  16. RPereiraGoXplora

    RPereiraGoXplora

    Joined:
    Dec 10, 2019
    Posts:
    11
    Hello, I'm using the unity version 2020.1.7.1f and every time i create a UI Document it never create the panel.

    But it appear in the debugger.

    upload_2020-10-1_17-39-35.png
     
  17. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Hey RPereiraGoXplora, I believe what you're seeing in the debugger is not a PanelSettings instance. If you don't have a PanelSettings asset in your project, you can do 1 of 2 things:
    1. Right click on the Project view and select Create > UI Toolkit > Panel Settings Asset, and then assign the created asset to the appropriate field on your UIDocument; OR
    2. Right click on the Hierarchy view and select UI Toolkit > UI Document, which will give you a new UIDocument with the PanelSettings already set, and then you can assign your UXML to it (and probably get rid of any previously created UIDocument that does not have a PanelSettings).
     
    JohngUK and RPereiraGoXplora like this.
  18. RPereiraGoXplora

    RPereiraGoXplora

    Joined:
    Dec 10, 2019
    Posts:
    11
    Hello JuliaP, i don't have those options,
    Only this:
    upload_2020-10-2_14-42-53.png
     
  19. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
  20. RPereiraGoXplora

    RPereiraGoXplora

    Joined:
    Dec 10, 2019
    Posts:
    11
    I had it installed, at least it appear checked, i install it again and it works now.
    Big thanks.
    Gonna do more tests next days.
     
  21. wixaratworkpride

    wixaratworkpride

    Joined:
    Oct 7, 2020
    Posts:
    1
    Awesome work guys, great tools
    i have a question, any plan to support RTL text?
     
  22. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,831
    +1
     
  23. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    327
    Some of the efforts for supporting RTL in TextMesh Pro has been temporarily suspended to focus on its integration in UI Toolkit. The work will resume once it's in a good place and we'll be able to provide an ETA.
     
    wixaratworkpride likes this.
  24. RPereiraGoXplora

    RPereiraGoXplora

    Joined:
    Dec 10, 2019
    Posts:
    11
    How can i add a list of countries to a Foldout and a then a list of languagues in other Foldout after select the country?
     
  25. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,010
    @benoitd_unity I see that in "com.unity.ui@1.0.0-preview.9" are you depending on nuget packages and adding them like an upm package also.

    A colleague of yours (@xoofx) created on github a really nice solution:

    https://github.com/xoofx/UnityNuGet

    Are you using something like this now?

    Historically, managing Nuget packages with their huge chain of dependencies in Unity has always been a major problem that is easily solved in .NET projects through the Visual Studio UI and the Nuget client.

    Is this something that you are working on internally at Unity that could be exposed to us at some point?
     
  26. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    327
    Hi, I'm not familiar with that area of the product. I recommend you reach out directly in the Package Manager section of the forum: https://forum.unity.com/forums/package-manager.150/
     
  27. OrlovskyConsultingGbR

    OrlovskyConsultingGbR

    Joined:
    Mar 17, 2020
    Posts:
    61
    I plan to use this UI Builder for creating UI for my game SOE2500 here are concepts for the UI https://github.com/orlovskyjavaprofi/SOE2500-UI-Concepts . The game planed to be a spiritual successor of Alpha Centauri game and this means i need to figure out how to display in UI the city from the plain on which i would draw it.
    SO basically it would look like a civ game here example
    civ3.jpg
     
  28. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Please create your own separate thread if you still need help with this ;)
     
  29. Tointer

    Tointer

    Joined:
    Mar 10, 2017
    Posts:
    5


    I get errors whenever I try to install UIToolkit. I tried it on 2020.0b2 and 2020.0b7, and with empty project too. What can be the issue?
     
  30. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    The latest version of the UI Toolkit package is only compatible with Unity 2020.2.0b2 and earlier, so make sure to use a compatible version. Is this error log from opening with b2 or b7? We'll wait for your confirmation before we can help you further.
     
  31. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    @JuliaP_Unity is there any broad release period programmed for a version that works with 2020.2?

    Unity is fixing a lot of game-braking and editor-breaking bugs at the moment in 2020.2 and getting stuck on 2020.2.0b1 (as b2 is completely unusable) fells like being constrained a lot.

    Thank you!
     
    tacman1123 and Shinyclef like this.
  32. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    732
    This is a very high priority for us. 2020.2.0b10 should go out some time next week and it will fix the long standing compatibility issues we're facing. We're hoping to have a new package version to go without at the same time, but cannot make any hard guarantee.
     
  33. vexstorm

    vexstorm

    Joined:
    Apr 26, 2020
    Posts:
    8
    I have reviewed a view posts related to Unity UI Builder and had a few pointed questions I wanted to verify please:
    1) Will this be retroactively be available to any LTS version of unity 2019.4.? I do understand there was a testing hidden package, but I am asking about the current one deployed
    2) Does this UI Builder support also developers for assets building custom inspectors and game making software (within Unity)
     
  34. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'm curious if the fix made it to b10? I know it's still broken with current ui toolkit 1.0.0-preview.9 so I'm assuming either fix didn't land on b10 or it additionally needs new package with implementation for the new API?

    Right now I'm seeing same behavior (error spam, editor starts on safe mode) with both 2020.2.0b10 and 2021.1.0a4 (both of these were released today) when testing with 1.0.0-preview.9.
     
    florianhanke likes this.
  35. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    The fix is in for Unity, we're working on a new package release that is compatible with it. Look out for the announcement here on the forum when it comes :cool:
     
    tacman1123, Karlbovsky, b4gn0 and 5 others like this.
  36. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    1,990
    I would like to ask again. Does the DOTS support preview version coming soon? Does it bundle into same UI Toolkit package or it's another new package?
     
  37. chad-wmgi

    chad-wmgi

    Joined:
    Mar 31, 2020
    Posts:
    8
    Is there a RawImage equivalent in the UIBuilder? I found the Texture and Vector option on the VisualElement but nothing for a RenderTexture.
     
    bashis likes this.
  38. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    You can manually add a <Image> visual element to your uxml and assign the rendertexture by code
     
  39. chad-wmgi

    chad-wmgi

    Joined:
    Mar 31, 2020
    Posts:
    8
    Awesome! Thanks.

    How about a method to rotate a VisualElement to create a loading spinner?
     
  40. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    I suggest creating a thread with the help wanted tag.
    To answer your question, you can:
    - Rotate the transform (results may vary AND they are going to publish a much better way to rotate thing)
    - Use a <Image> visual element, pass a flipbook texture to it and change the SourceRect of the Image with a C# script (I suggest using a coroutine)
     
  41. tacman1123

    tacman1123

    Joined:
    Sep 14, 2020
    Posts:
    77
    2020.2 is on beta 10 now, 2021 has its first alpha. Is this still relevant? Can it run in the latest 2020.2 beta?
     
  42. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    UI Toolkit is still broken on both latest 2020.2 beta and 2021.1 alpha apparently due to still missing update for the ui toolkit package itself (to make it compatible). All we can do is wait or use 2020.1
     
    florianhanke likes this.
  43. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,203
    Friendly reminder that it's best to start a new thread for questions or issues instead of asking in this thread. You're more likely to get an answer.

    But for some quick unanswered questions I saw above (that I can answer today):

    UI Builder already supports 2019.4 and will likely continue to support 2019.4 LTS for the rest of the LTS support cycle (with some restrictions as not all features of UI Toolkit itself will be available in 2019.4). Not sure what you mean by "hidden package". The UI Builder package was never hidden. It's just under the preview filter in the Package Manager.

    Support for custom inspectors in the UI Builder will not be part of the 1.0 release for 2021.1. They are slated for a future release. But we know they are an important feature.
     
    Last edited: Nov 12, 2020
    Karlbovsky and JohngUK like this.
  44. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    327
    Unfortunately, efforts in that area were not conclusive enough to be shared. We'll report back once we have a plan we can share.
     
    optimise likes this.
  45. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    1.0.0-preview.11 is out now :)
     
    kai303, florianhanke and Kirsche like this.
  46. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    823
    unfortunately it appears the latest packages for inputsystem still has issues with ui toolkit(cyclic references assembly errors)

    edit case 1292627- fairly simple to repro make new project with b10/11, add uitoolkit then add inputsystem or vice versa
     
    Last edited: Nov 14, 2020
  47. DrSeltsam

    DrSeltsam

    Joined:
    Jul 24, 2019
    Posts:
    100
    The changes and new features introduced by 1.0.0-preview.11 look extremely promising, but unfortunately the cyclic references (as mentioned by @thelebaron ) are a show stopper :( I really hope this gets sorted out quickly...

    //Edit: The cyclic reference error is apparently fixed with 1.0.0-preview.12, thanks for the fast update ;)
     
    Last edited: Nov 17, 2020
  48. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    471
    I'm really looking forward to jumping 9 versions from 2020.2.0b2 to 2020.2.0b11 (or more by the time we can)... maybe the beta cycle will be over? :D

    Well I really hope it's a priority to get past b2...
     
  49. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    We literally have to use a19 because animation rigging has been broken on b1 and b2, so we are waiting to get 13 versions of fixes and improvements!
     
  50. adsamcik

    adsamcik

    Joined:
    Jan 13, 2013
    Posts:
    37
    Yeah it is quite unfortunate, I had to pause the project I work on for awhile, because b2 is just too broken, I had to sometimes restart and even reimport the project multiple times a day. And I must say it is quite frustrating that it has been almost two months without a working release for newer versions. Hope the fix for cyclic dependency comes this week.

    EDIT: sooo the preview 12 came out which has it fixed, neat.
     
    Last edited: Nov 17, 2020
    Dephora likes this.