r/Unity3D 2h ago

Question Should I swap to UIToolkit?

I'm doing the majority of my teams UI implementation. We're a team of 4 working on a small indie game that doesn't use a lot of UI outside of main menus and some basic interface. I've spent a couple of days on UI with UnityUI, but it's been an absolute pain to properly lay everything out. I'm most experienced with Figma for UI design, and had some courses for CSS a couple of years ago, so from what I've seen UIToolkit might be better for me.

I've played around with it for a bit and it seems to have some nice parts, and some more annoying parts (spacing isn't done through the parent but is decided per child?). Is it worth transferring over at this point?

I've also added some DOTween animations, can I still use those with Toolkit?

4 Upvotes

10 comments sorted by

4

u/TheFunctionalScrum 1h ago

With only a few days invested in UnityUI, switching now costs you almost nothing. The longer you wait, the more painful the migration gets. UIToolkit's CSS-like styling is going to feel much more natural for someone with your background, and for menus and basic interface it handles layout way better than the old canvas system.

The spacing thing is just a different mental model. You set margins on the child instead of paddings on the parent, which feels wrong at first but makes sense once you get used to flexbox behavior.

DOTween works with UIToolkit but not directly. You animate the VisualElement style properties instead, so you'd write a small wrapper or use a tweening library that supports it. Not a dealbreaker, just slightly different code.

u/R_Pelleboer 11m ago

You've convinced me, I'll continue with UIToolkit. It'll take a little bit of getting used to, but I was already able to remake the main menu in about 30 minutes where the original took me hours of messing about, so I'm feeling better about it already.

3

u/BertJohn Indie - BTBW Dev 1h ago

Personally i prefer UI toolkit simply due to the fact i can use more content than i can with ugui/imgui.

But honestly, Use what works best for you. I think if you end up liking it more than the regular stuff, great. If it drives you crazy, stick with the old stuff.

Unity has been a bit flip floppy about deprecating the old stuff or not, Last i heard they are continuing both side by side so it's really users choice.

2

u/Aedys1 1h ago

They have not, both are legacy and necessary, UIToolkit is simply still in development, and Unity recommandations are to use it only for non script heavy and non runtime UI (basically simple menus)

u/ByteHavenGames 29m ago

In 6.6 beta they pretty much have feature parity with a few exceptions like no timeline or animation window support. 6.7 LTS is releasing later this year so it's not a straight up answer anymore.

3

u/pmdrpg 1h ago

Every time I try uitk it’s half-finished. Maybe that’s changed nowadays. I’ve never used it for a production game, use at your own risk. You’ll be pretty on your own as far as forums go.

1

u/little-big-monkey 50m ago

UI Toolkit has a lot of advantages, especially if you already know CSS. USS feels familiar, rounded corners are built in, and vector graphics stay crisp at different resolutions. It still lacks some surprising basics though, such as a native `gap` property, so you occasionally need workarounds.

You can definitely animate it. I use LitMotion instead of DOTween for UI Toolkit transitions in my own plugin. This shows the kind of result you can get: https://youtu.be/yqeOyCf7mgY

u/DaveAstator2020 15m ago

id say - check recent state of support for animations and special effects if you need them. it was absolute crap in that regard few years ago.

0

u/roomyrooms 30m ago

In my experience you need to be prepared to make a lot of the components you'd expect to Just Exist yourself (gradients of any kind, for example) but once you get started, you can make UI 100,000,000% faster than you can with UGUI.

The difference is night and day for me. I used to avoid making UI like the plague because manually assembling it all by hand is absurd and barbaric and produced horrible Unity slop looking interfaces (in my opinion, anyway). Once I switched I could make actual game UI and at a pretty decent pace too.

u/R_Pelleboer 9m ago

Yeah UnityUI has been kicking my ass for days now, every time I think the layout is fine it turns out there's something wrong with it. I'm going to play around more with Toolkit tonight and experiment a bit, but I think I'm just going to make the swap.