Get started with UI Builder (UI toolkit) - time to ditch old UI system?

Поділитися
Вставка
  • Опубліковано 1 сер 2024
  • 🎁 Support me and DOWNLOAD Unity project: www.patreon.com/posts/5233763...
    This tutorial/guide will show you how to get started with the new UI builder (UI toolkit) package in Unity. I know that many of you prefer to white your UI in code or would like to have some kind of standardised way of doing that. While I myself love older UI system I also see a lot of positive aspects of this method. I will show you how to create a simple labels, buttons, visual elements and how to style them. Finally at the end we will write some code to make our UI interactive.
    If you'd like to see more UI builder in action, check out my previous livestream where I explored this package: • Alternative to Unity U...
    💜 Join our Discord: / discord
    🔵 Follow me on Twitter: / bionicl333
    You will learn:
    - How to create a button in UI builder
    - How to create a label, text in UI toolkit
    - What is UI builder package
    - What are the alternatives to Unity UI system
    - How to code UI builder layout
    Timestamps:
    0:00 - Intro
    0:49 - Installing
    1:50 - Setup
    3:22 - Adding components
    4:36 - Placing
    6:58 - Absolute position
    8:26 - Styles
    10:13 - Hover/active attributes
    11:23 - Code setup
    14:01 - Coding buttons

КОМЕНТАРІ • 171

  • @harshadjoshi3944
    @harshadjoshi3944 3 роки тому +16

    Saw a few of your tutorials on UI implementation and they are really well done. There is a lack of tutorials explaining use of UI tools within unity and I am really glad you have picked up these area of unity to make tutorials on. Please keep it up👍👍✌️

  • @CareyMcDuff
    @CareyMcDuff 2 роки тому

    Thank you for this! This is the only video I've found that explains how simple it is to create a UI Document object and asset to make a button menu. I'm just getting started in Unity. One reason I did so now is this new UI system. I'm glad I waited and never had to learn the old one!

  • @jeremiasp314
    @jeremiasp314 Рік тому +2

    This is objetively the most well polished introduction to the topic I found so far. The work on it is noticeable. Thank you!

  • @serialexperimentsdave7213
    @serialexperimentsdave7213 Рік тому

    Thank you, I watched a bunch of tutorials trying to figure out how to change the hover color of a button, your the only one who didn't gloss over it in a vague way.

  • @SBARevere
    @SBARevere 3 роки тому +20

    I was definitely one of those that said they disliked working on UI so this is going to be a huge help!

    • @xXYourShadowDaniXx
      @xXYourShadowDaniXx 2 роки тому +1

      I couldn't stand the old UI system either its so bad for simple 2d ui's imo.

  • @crazyfox55
    @crazyfox55 3 роки тому +5

    Yesterday I watched the live stream of UI Builder and subscribed. I guess I have good timing.

  • @abdulkadirdursun6072
    @abdulkadirdursun6072 3 роки тому +13

    This might be the best video about UI Builder so far. Unlike other videos very clear, easy to understand. Before this ui builder looks like a ton of messy buttons, screens etc for me :D

  • @bramblewoodhall4757
    @bramblewoodhall4757 2 роки тому

    Brilliant! - Clearly explained and gets me up and running with UI Builder with useful examples. Thank you.

  • @Bambalombo
    @Bambalombo 2 роки тому +1

    It's insane to me, that you don't have more subscribers. Love your content :-) Thank you.

  • @touzimsky
    @touzimsky 3 роки тому +23

    Having a lot of experience with CSS I am really looking forward to UI Builder. From your video it looks pretty straightforward to use.

    • @terryfries
      @terryfries Рік тому

      It really is a dream come true!

  • @matt1988ish
    @matt1988ish 2 роки тому

    Holy cow, UI Builder is exactly what I've been looking for in a UI solution for Unity. This is amazing.

  • @pixelspaghetti
    @pixelspaghetti Рік тому

    This video is uber-helpful, literally no better place to start off with the UI toolkit, thanks a lot!

  • @SeanNamsangwoonam
    @SeanNamsangwoonam 2 роки тому

    This was very helpful! Looking forward to more videos on UI Builder!

  • @altafnavalur
    @altafnavalur 3 роки тому

    One of the best tutorial to get started with UI Toolkit. Thanks!

  • @Aaron-ks1lz
    @Aaron-ks1lz 2 роки тому

    Great job and keep it up! Would love to see some more in-depth videos on UI builder, as there is a real lack of them on youtube atm.

  • @ruslan_yefimov
    @ruslan_yefimov 2 роки тому +2

    So easy.. Loved your tutorial, thank you man!

  • @TheLazyIndianTechie
    @TheLazyIndianTechie 2 роки тому

    Great tutorial. Always wondered what UI Doc was. Thanks!

  • @anbagames
    @anbagames 2 роки тому

    Thanks for the video! Will definitely check out UI Builder soon in my new project :)

  • @behnamrasooli8801
    @behnamrasooli8801 2 роки тому

    Very professional presentation! Thanks a lot :)

  • @darrylwolfe7359
    @darrylwolfe7359 2 роки тому

    Just when Im getting used to creating UI, now I discover this UI Builder.

  • @CreativeSteve69
    @CreativeSteve69 3 роки тому +1

    thanks so much for making this UI tutorial. just saved it on my playlist. Still making my Ludum dare game to completion and being a weird beginning game dev I am. I was looking to build my UI first before I come up with my game loop idea. lol

  • @alexter-sarkisov8321
    @alexter-sarkisov8321 Рік тому +1

    Excellent intro tutorial! A couple of points: 1) in my version (2021.3.25f1) you have to manually click 'Add default input modules' in the Event System, otherwise nothing works, 2) When I create button style, font size for some reason defaults to 9.

  • @alvin4100
    @alvin4100 2 роки тому

    Its great im thinking of using this for our new project.

  • @gfujigo
    @gfujigo Рік тому

    Awesome work!!! Explains a lot. Thanks!

  • @ihearcolors6216
    @ihearcolors6216 2 роки тому

    This has a bootstrap studio vibe to it, and I am liking it!

  • @syeddaniyalhaidernaqvi6684
    @syeddaniyalhaidernaqvi6684 3 роки тому +43

    Maybe one day I'll switch to this UI Builder.. but for now I prefer the old one.. BTW your teaching style is concise and easy to understand. Thankyou for this❤

  • @siyuanrocks
    @siyuanrocks 2 роки тому

    Very good tutorial! Thanks man!

  • @skippythemagnificent8103
    @skippythemagnificent8103 3 роки тому

    Excellent Tutorial, many thanks

  • @maxpayenvenic6029
    @maxpayenvenic6029 3 роки тому +4

    now with a bit of CSS skill I able to design UI I always wanted, thx

  • @mintydog06
    @mintydog06 2 роки тому

    Great tutorial, thanks.

  • @fokeyjo
    @fokeyjo 10 місяців тому

    For anyone coming to this on newer Unity versions, the visualElement can now be center-aligned by using the alignSelf option in the Align properties.

  • @VickingDev
    @VickingDev 2 роки тому

    Excellent, as android studio cool, let's make some test to see if this tool is so great. Thanks for the video.

  • @flaviokonti5522
    @flaviokonti5522 3 роки тому +1

    Thank you this will help

  • @AliveNotDeadmund
    @AliveNotDeadmund 2 роки тому +2

    Thank you for this fantastic tutorial! One thing I didn't understand was using the root variable. Does setting the root visual element establish the UIDocument in use? And does 'root.Q' effectively query the root for object(name)?

  • @MaxAigner
    @MaxAigner 2 роки тому

    Thank you for this great tutorial, it helped me a lot to see where all the elements are and how to use styles! What a blast! Btw. is there a way to do databinding as well? I have read something about it, but wished there was a proper tutorial for it..

  • @xvnexus8814
    @xvnexus8814 2 роки тому

    This guy is underrated af I'm subscribing

  • @icaroamorim3123
    @icaroamorim3123 Рік тому

    A good video like this makes 16min feel like 2 minutes

  • @freefireturk289
    @freefireturk289 3 роки тому +1

    We miss you 🚀💪🏻

  • @angel_luis
    @angel_luis 3 роки тому +17

    Just as note, "Canvas Background" isn't the finish Background, it's just for editing. If you want to create a solid background, you have to create a VisualElement (like a Image in the old UI system).

    • @CocoCode
      @CocoCode  3 роки тому +1

      Great note!

    • @angel_luis
      @angel_luis 3 роки тому

      @@CocoCode 👍in my case I prefer that system because as Senior web developer, to have CSS properties is an advantage.

  • @hweeli6228
    @hweeli6228 2 роки тому +1

    it is a good tutorial to learn the new UI Elements, can you cover the UI scale change relative to screen size as well ? I found it is a bit difficult to deal with it .

  • @ricocarpe6993
    @ricocarpe6993 2 роки тому

    Excellent it seem to be the same as Android studio cool. I had to test if it is working with New input système. Thanks a lot for your vidéo.

  • @Tarodev
    @Tarodev 2 роки тому +58

    This was a great tut. Is there really no way to assign buttons to serialized variables in code? I HATE the fact we have to reference the buttons by a string name...

    • @codemonkeynorth7503
      @codemonkeynorth7503 2 роки тому +2

      It’s essentially an xml document so it works like jQuery does with html?

    • @codemonkeynorth7503
      @codemonkeynorth7503 2 роки тому +2

      You could probably write an editor script to generate scriptable objects representing the elements but it’d be awkward to maintain with any changes to the document I guess.

    • @ark_ryl9384
      @ark_ryl9384 2 роки тому +6

      @@codemonkeynorth7503 Pretty much this. They really wanted to emulate the web development experience, even down to using strings to select elements.

    • @domportera
      @domportera Рік тому +1

      i feel the same way. btw love your vids :)

    • @Tarodev
      @Tarodev Рік тому +1

      @@domportera I love you

  • @CodeWithMat
    @CodeWithMat 2 роки тому

    Interesting tutorial :)

  • @optiontrading4926
    @optiontrading4926 3 роки тому +1

    I Liked That "Public" 12:49

  • @sun4442
    @sun4442 3 роки тому

    You are a gem brother

  • @rodrigosemfio
    @rodrigosemfio 3 роки тому

    Very good video, it helped me a lot, I didn't know where to start.
    Is it possible to create this programming with Bolt/VisualScript?
    I am wanting to unite the two.

  • @nanhuchunshan
    @nanhuchunshan 2 роки тому

    太有用了,感谢感谢

  • @trkkkmatmat6070
    @trkkkmatmat6070 3 роки тому +1

    Helpful

  • @juancastresana8902
    @juancastresana8902 2 роки тому +1

    Thank you! I learnt a lot about this UI Builder but I think you should stop at some parts of the code and explain what each line does.

  • @mashermack
    @mashermack Рік тому

    oh my god, coming as web development this is a godsend, basically css on unity - which I always thought why they never integrated something easy than their old UI system.
    I'm in awe!

  • @Nacho_Bear
    @Nacho_Bear 2 роки тому +1

    when I create the UI Document, it has no Event System Component. I downloaded both packages so I'm not sure why that is. anyone have any ideas whats going on?

  • @BNuwan123
    @BNuwan123 3 роки тому +1

    May this channel become more spread....

  • @btarg1
    @btarg1 Рік тому

    This looks a lot easier than using the traditional canvas system, now I'm annoyed with myself for ignoring UI Builder. I'll use it in any future projects

  • @pentorie
    @pentorie 2 роки тому

    Does USS supports some cutting-edge features like backdrop-filter etc? If it is then i probably found a perfect addition ☺️

  • @xdanic3
    @xdanic3 2 роки тому

    15:28 So the difference between js and unity is that you add the methods to the buttons "clicked" field thanks to the operator overloading functionality of C# (using the + (+=) operator) I guess.
    Then what would usually be called the "documentElement" is the "rootVisualElement" (line 17)
    Also the VisualElement might the a good ol' div tag.
    Everything else is pretty much the same.
    As an improvement, I would recommend not duplicating the button style, or at least cleaning the USS code, since there might be many properties with the same values in the hover and active state

    • @AFlyingBird702
      @AFlyingBird702 11 місяців тому

      the clicked field doesn't have much to do with overloading operators.
      clicked is a c# delegate event that you can add methods to. you could do clicked = clicked + OtherMethod too, += is just a shorthand

  • @kitkatmt1696
    @kitkatmt1696 3 роки тому +2

    I really like the smooth tweening in your videos, what video editing software do you use ?

    • @CocoCode
      @CocoCode  3 роки тому +1

      Glad you like it! - I spend a lot of time on editing ;)
      I'm using ScreenFlow on Mac

  • @MadHaTr4LiFe
    @MadHaTr4LiFe Рік тому

    When creating a UIDocument It does not come with the Event System (UI Toolkit) component. Which I think is why my button clicks are not registering. I can't seem to add that component either.

  • @DeLaBerni
    @DeLaBerni 10 місяців тому

    Is it possible to make a "Inputfield" ? Because I want give it a try with the Login UI!

  • @LostStylus
    @LostStylus Рік тому

    11:01 - hover doesn't work for me in the editor only in game view in play mode

  • @sinanarts
    @sinanarts 2 роки тому

    Can i use this toolkit for creating a UI for my VR GAME.?

  • @paradisefallen8385
    @paradisefallen8385 2 роки тому

    what about onscreen controlls like onscreen joystick?

  • @n_mckean
    @n_mckean 10 місяців тому

    For some reason, Unity doesn't let me drag a TMP Font Asset into the UI Builder Inspector to change the style. I can find a Font and set the asset to None and get the result, but the preferred method is to use a Font Asset. Any ideas why I get a big red crossed circle when I try to drag it and if I click to open the selection panel instead of dragging, my asset isn't there as a choice. I've wasted hours on this.

  • @mehmetcan3825
    @mehmetcan3825 2 роки тому

    I downloaded both package but it gives me error, error CS0006: Metadata file 'Library/ScriptAssemblies/UnityEditor.UIBuilderModule.dll' could not be found.
    How can i fix it?

  • @Cloud-Yo
    @Cloud-Yo 2 роки тому

    how about perormance? is this new system better with canvas rendering?

  • @mihainegrisan
    @mihainegrisan 2 роки тому

    UI Toolkit submenu doesn't appear in my hierarchy but it does appear in my Project tab. Do you have any idea why?

  • @beefy___
    @beefy___ Рік тому

    How would you clone new buttons from a script?

  • @noodle-eater
    @noodle-eater Рік тому

    I admit this is looks interesting compare to making ui in the legacy system. If they really take reference from unreal widget editor I hope they have somekind of automatic code n ui binding.

  • @chrisharvey7461
    @chrisharvey7461 2 роки тому

    how an earth do you get buttons side by side

  • @RG_77
    @RG_77 2 роки тому +4

    Followed step by step but the secondary Event system (UI) did not load onto my object.

  • @canpofficial
    @canpofficial 2 роки тому +3

    The tutorial looks great but on 2021.2.3f1 I can't follow it. Components created are different.

  • @jin416
    @jin416 2 роки тому

    is there performance improvement with this new one?

  • @martindubois9279
    @martindubois9279 2 роки тому

    seem there is no more event system in component on unity 2021.2 :S

  • @justvlaxx1260
    @justvlaxx1260 2 роки тому +4

    I like the idea of UI Builder but for now I am going to stick to normal UI. Looks more complicated for coding than it should be. Changing the name of a button in UI Builder will screw your whole code (Of course, you should start coding after you planned everything). With standard system that is not the case.
    I don't know, there are a lot of positives but a lot of negatives as well but I also didn't like the Tween package and now I can't live without it when creating simple game animations or UI animations, like:
    1) Move platform left/right with oscillations (sin axis) - 1 line of code in Tween, that is better optimized, instead of creating the whole function that will be ran in Update every frame.
    2) Rotation - easy to create and not using update function (pretty sure Tween uses some weird optimization with Update, still new with it and reading the documentation)
    3) UI animations - coins pickup from the current position to UI coin location, etc.
    All I am saying is that UI Builder might grow on me. After the current project for the company I will try it for a few days/week to see what I really can/can't do with it. The same way I did with Tween and now I use it for most of the simple animations.
    Thanks for all the UI videos, made me learn a lot and hopefully you will be here for along time to educate people like me! Thank you very much man!

  • @ChessShorts292
    @ChessShorts292 3 роки тому +1

    Go on you are helping people I recently started coding and had trouble and you vids helped me ofcourse you are not as good as someone like brackets but keep going and you will get there

  • @matthewbacklund5145
    @matthewbacklund5145 2 роки тому +1

    In the latest version of unity the code in this tutorial will give errors.

  • @plagues90
    @plagues90 2 роки тому +1

    How do you do a responsive UI by using UI toolkit ? it is too hard?

  • @USSR-Lenin-Stalin-Forever
    @USSR-Lenin-Stalin-Forever Рік тому

    how to make automatic text size?

  • @rancherosdigital6851
    @rancherosdigital6851 2 роки тому +7

    I see that UGUI has a lot of drawbacks, but I don't see the advantages of the UI Builder. In UGUI I can drag and drop components and Unity events directly in the inspector and don't have to reference widgets by string in code. I can set up the wildest UI animations. And I can use World Space Canvases. I can have 3d objects inside the canvas, and all that stuff, since the UI is composed of GameObjects and MonoBehaviours. How am I supposed to do that with the UI Toolkit package? Does this new UI have a better performance? Does it have better implementations for inputfield and scrollview? Can the CSS and XML files be changed externally after the build? Can I add custom widgets and layouts?

    • @AlexDoesYouTubes
      @AlexDoesYouTubes 2 роки тому

      UGUI also works, at least for WebGL, UI Builder errors out and won't show up on an actual build.

    • @leeoiou7295
      @leeoiou7295 Рік тому +2

      Same question I have been asking. UI builder is taking us from 2015 back to 1970.

  • @VEOdev
    @VEOdev Рік тому

    As some one who used to work in HTML and CSS when making UI, this is really good add to Unity, for sure my next project will use this UIBuilder, for now I'm too deep on my project I can't switch, already wasted so much time creating assets in photoshop while you can do them easily with this new tool it also save some app space

  • @miamouse765
    @miamouse765 2 роки тому

    I don't see the button I made!

  • @edwinbradford
    @edwinbradford 3 роки тому +4

    Strange... my game object created by right clicking in the Hierarchy panel > UI Toolkit > UI Document does not contain an Event System, only the UI Document. I am on Unity 2020.3 with Unity Builder package 1.0.0-preview.14.

    • @thomastassi7974
      @thomastassi7974 3 роки тому

      I experienced the same issue with Unity 2020.3. Tried with his version of 2020.17 and the Event System showed up. :)

    • @kpro9047
      @kpro9047 3 роки тому

      Same issue with 2020.3.

    • @kpro9047
      @kpro9047 3 роки тому

      Unfortunately, changing versions to 2020.1.17 from 2020.3 did NOT solve the problem for me. I think that it has to do with an outdated com.unity.ui package. In any event, there has been a beta release at 2021.2 which has the Unity builder installed. This tutorial works with the new beta.

    • @ChrysusTV
      @ChrysusTV 2 роки тому

      In any case you can add an Event System anywhere in the hierarchy. It also did not add an Event System for me but I already had one elsewhere in my scene.

  • @yifengchen5274
    @yifengchen5274 2 роки тому

    yet the text is still blurry for small font size

  • @bradleybergstrom123
    @bradleybergstrom123 3 роки тому +3

    Is this ready for production? Or is it still too buggy to use?

    • @TheBlazingWolfie
      @TheBlazingWolfie 3 роки тому +1

      well....it corrupted my entire game so...dats your call lol

    • @coreysonofander
      @coreysonofander 2 роки тому +1

      Downloaded it today. It's still in the Preview stage as of Dec 1, 2021. I imported it into my project (Unity vers. 2020.3.22f1) and the console spit out a bunch of warnings and errors, mostly to do with trying to import the StyleSheet.
      There are sample scenes you can also import from the git packages. Perhaps these will work better but I would recommend importing them to a new project just to be on the safe side.

  • @jin416
    @jin416 2 роки тому

    just like unreal UI great!

  • @bhanukadasanayaka3457
    @bhanukadasanayaka3457 2 роки тому

    can you more tuts on unity ui builder

  • @OU20GAMES
    @OU20GAMES 3 роки тому

    Muito bom.

  • @Stas3g
    @Stas3g 3 роки тому +3

    For newbie, all of this coding things looks more complicated. Just creating UI elements directly in Unity looks still clearer. I thought this Builder will make the coding work easier, but looks like its only add the CSS-like-style possibilities.

  • @youhoueu
    @youhoueu 2 роки тому

    I've tried your tutorial for UI Builder, but when I try to interact with buttons in game, I get the error "InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings". Any idea on how to fix this ?

    • @sirflimflam
      @sirflimflam 2 роки тому +2

      Sounds like the UI Builder library is using the old input management routines, while your project is setup with the new input manager.

  • @Playlist8495
    @Playlist8495 Рік тому

    hmmmm It wont add the Event System automatically if I add UIDocument...
    In fact, I have no Event System (UI Toolkit)

  • @GameDevGeeks
    @GameDevGeeks 2 роки тому

    cannot install the packages :(

  • @stzaske
    @stzaske 2 роки тому

    Your video was great...the UI Builder on the other hand, very buggy. I'd keep editing my UI and the app would crash and throw away all my changes. Very frustrating. It's 2022 and this still seems very buggy and not ready for use.

  • @greenTech88
    @greenTech88 3 роки тому

    Old project new version unity converter tutorial plz

  • @NehezTheWrackful
    @NehezTheWrackful 2 роки тому

    I guess web devs will be able to write Unity Ui now :)

  • @jimurbas7481
    @jimurbas7481 3 роки тому +2

    > [is it] time to ditch old UI system?
    Not for a while. The text input control, particularly multi-line editing is so buggy as to be unusable. The current version as of this date (1.0.0-preview.14) is no where near production ready.

  • @tatoforever
    @tatoforever 2 роки тому +1

    What most people dont get is that UI Elements allows you to separate UI visuals (widgets), logic and data and has a powerful UI builder tool too

  • @juezna
    @juezna 3 роки тому +1

    I wonder if they made it so you can animate buttons without refreshing the entire UI on every frame.
    Otherwise, it's LeanTweens for me.

    • @Songfugel
      @Songfugel 3 роки тому

      Wasn’t that bug fixed years ago?

  • @theashbot4097
    @theashbot4097 8 місяців тому

    I am sue you get this question a lot, but what IDE do you use?

    • @CocoCode
      @CocoCode  8 місяців тому +1

      Hey! At the time of recording this video I was using Visual Studio for Mac. Since then I switched to Visual Studio Code, here is a video about it: ua-cam.com/video/X8Qr78Vs0Ss/v-deo.htmlsi=VrVUjfTugN4SpbaQ

    • @theashbot4097
      @theashbot4097 8 місяців тому

      @@CocoCode Thank you soo much!

  • @MDProgramming
    @MDProgramming 2 роки тому +2

    Good luck animating them without coding. Actually the old UI system is less confusing and more flexible.

  • @50Gameplay
    @50Gameplay 3 роки тому +11

    Good video. In my opinion it doesn´t make anything really easier.

    • @CocoCode
      @CocoCode  3 роки тому +11

      I'm also not a fan of the new system - mainly because I tend to build much more complicated UI systems. But it's good to see some other options!
      Myself I see that UI builder as a great tool for building inspector windows etc. - for runtime the current system it's much more universal

  • @farrukhmalik8747
    @farrukhmalik8747 3 роки тому

    Hi. How to make an animated kill Popup like in Valorant.

    • @ruslan_yefimov
      @ruslan_yefimov 2 роки тому +2

      Well, you have to either calculate scale and position of popups manually, or just ditch this new ui system