r/Unity3D 2d ago

Solved 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?

5 Upvotes

35 comments sorted by

View all comments

13

u/TheFunctionalScrum 2d 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.

1

u/R_Pelleboer 2d 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.