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

Feedback UI Toolkit and UI Builder is a mess.

Discussion in 'UI Toolkit' started by Unique-Player, Sep 25, 2023.

  1. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    59
    Since i have started using new UI system for the project, i could not but notice how messy it is. You can probably already tell from some of the posts i have made here on forum, but that is just a tip. Ignoring all errors and its messages that require restarting the UI builder or the project, there is plenty of issues with how things work internally in the new ui system altogether.

    If the goal was to replicate workings of the web pages, you have failed. And everytime i will get bored spending hours trying to understand what exactly is wrong and what workaround i can utilize, i will be spamming here on forums about the issues i find (not hard to do).

    How come the system that is in the workings for 5-6 years? (Announced in 2017, Roadmap in 2018, First release in Unity 2019) still does not have solid foundation?

    It might sound harsh, but it has been a fact for many years at this point that the so called new standards do not meet even the lowest expectations.

    Brought to you by me trying to make a wrapper that holds items of certain width/height percentage. If you add padding/border the percentage calculations are completely wrong. The only possible solution at the moment is to hard code width and height, since unity does not even have calc function that would make it possible to work around these issues very easily.
    duck.png
     
  2. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    If you want a UI in a Unity game and you want to stay sane, use the old system of TextMeshPro and Canvases.

    You'll also be able to position the UI in 3D space.

    And next things in smaller sub-canvases for optimisations of the solvers. This works pretty nicely to constrain (excuse the pun) resolving to only the dirty sub-canvas.
     
  3. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    59
    It seems to be the option, but when you are alredy in mid-development it is still a little troublesome to change everything. Will see what can do
     
    Unifikation likes this.
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    Well without seeing any code or UMXL it's impossible to say what you're doing right and wrong.

    You should merely have to make the max-width of these image visual elements 50% so that they grow/shrink with their encapsulating visual element. And if it doesn't work then that's probably a bug that needs reporting.

    Overall I much prefer UI Toolkit to the arguably clunkier uGUI system.
     
  5. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    59
    Well, to prove that it is not on my end i attached how it should look like making the replica in web, unity`s system is incomplete and buggy, how come after so many years it is still this messy i have no idea.
     
    Unifikation likes this.
  6. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    It's not meant to be a 1:1 parallel, it's just meant to be a similar workflow. Web dev is equally as messy if not more so.

    I've done layouts similar to what you're trying to do and it really wasn't a hassle to get it running. So I'm just trying to help point you in the right direction.

    No need for the attitude.
     
  7. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    59
    Nobody asks for 1:1 parallel, that is why i try to emphasize that inner calculations of the new UI system is completely broken. Also, pretty strong claim that web is messy. Never i have encountered any issues when working with the web in contrast to the never ending errors i am dealing with the new UI system.

    If you say you have done something similar, explain me this.
    Wrapper - 300px width, height.
    Inside of it sit 6 elements
    - Width 48%
    - Height 31.32%
    - Margin 1%
    Now try to change width of the wrapper and see what happens.

    Without hardcoding it is a mess.
     
    Unifikation likes this.
  8. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    969
    Is there a project you can share or at least the USS? It feels like calc() shouldn't be required for this use-case. And if we're implementing the box model wrong, we certainly want to know about it.
     
  9. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    59
    Read my last message.
    I believe there is not even a border/padding issues, but wrong calculation of the element sizes. I even attached a video showing the issue.
     
  10. Hellfim

    Hellfim

    Joined:
    Sep 11, 2014
    Posts:
    91
    Would be great if you file a bug report with a repro project. I believe I experienced somekind of a same problem, but managed to workaround it and didn't bother reporting the problem.
     
  11. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    969
    I investigated a bit on my side, this seems like a legit bug to me, definitely worth filing a new issue (Help > Report a Bug...).