Yeah exactly, i've said the same thing elsewhere. Like, people with official Unity affiliation/partnership or whatever publish terrible tutorials because the content has no real world use or are horrifically non performant or unmanageable. You follow the others tutorial and yeah, it works, but its not until then that you realise its not something you can ever actually use. It's just a lesson on how not to do something most of the time. And even if you're not going to use a specific thing in Tarodev's vids, you will almost always learn something useful generally.
As an alternative workflow to using OnValidate, you can do the following: 1. Create a script and name it 'MainMenuScreen', deriving from VisualElement. Add the following 'UxmlFactory' code to have it expose in the UI Builder (docs.unity3d.com/Manual/UIE-expose-custom-control-to-uxml.html). 2. Create a UIDocument file and drag your exposed MainMenuScreen control into the view. 3. Drag the UIDocument file into the source asset of the UIDocument component. Now your changes in MainMenuScreen script will reflect just as OnValidate would. Also, here's a 1-minute video about UI Toolkit responsiveness: th-cam.com/video/xbEcynEnKLI/w-d-xo.html
on a more serious note, If unity adds a "standard apps" Update loop (things are not re-drawn every frame) then it can be a very powerful non-game apps tool.
Unity actually already is a very powerful non-game tool, especially if you're doing anything like simulation or visualization. If you'd like to manually control update cycles for your scripts you could already use FixedUpdate, though often times an event pattern is more robust for those kinds of applications. Anything that you'd be simulating would probably have to be updated every frame anyway.
Am not talking about script updates, am talking about frame re-draws. Also. yes for anything that require 3D or simulation, unity is great for non-games apps, but imagine doing something as simple as a " calendar app" (yes, why use unity for that) but let's supposed its a very typical calendar app, but it has a total different scene where you can see super cool 3D achievements. For the achievement scene, the way unity render things make total sense (re-draw every frame) But for the Calendar part, a more traditional way is crucial, otherwise you will have a Calendar app that drains battery with the same rate as a Game, which is unacceptable. Godot for example offer a solution where the UI only ger re-drawn if a change happens. if you open the youtube app and stay in the homescreen for 2 hours without anything moving (not even video previews) it will consume less battery than opening a unity mobile game with only one single sprite in the scene.
As a frontend web developer in my professional life, this makes so much more sense to me. Now we’ll see if I can figure out a way to make reusable components like React in the Unity Toolkit. I’d be unstoppable. Thank you so much for the tutorial, this helped immensely! My biggest blocker was figuring out a better way to add functionality than the way their sample project does it, with a million string ID queries.
Use UIDocument instead of programmatically. This video is completely defeating the purpose of UIDocuments. Separate, model view and presentation, which are c#, uxml and uss respectively here…
Thank you for showing off this workflow! The "recommended" workflow is honestly unbelievably bad for larger scale projects but I resigned myself to using it before seeing this and realizing I could just write extensions and factory methods to make building UI through C# much more readable.
th-cam.com/video/9tqet1rQw5k/w-d-xo.html help me unity keeps crashing on creating any kind of new project in any version of unity whether it's new, old or LTS...
Thank you so much for this. I've been going through the official documentation but couldnt really wrap my head around it. This showed me everything I needed to know. Thanks
Mate, I know jack all about this stuff. But listening to your clear and coherent explanations of what you're doing and why, makes it a really easy listen while learning something that I'm sure many people are looking to learn. Thanks for the awesome vids.
Great video as always, I have been very interested in this package since it was announced but mostly for Editor use. Even tho I do find it very useful for editor UI, I do think it's a bit weird to use for runtime UI (at least in its current state). And from what I could find the recommended way for runtime UI is still Unity UI (I would have left a link to the page but it seems like I cant let a comment with a link inside it) at least for the moment.
What do you think about using the UI Toolkit with the MVVM architecture pattern? The UI Toolkit is most suitable for this purpose, and you can easily separate the data presentation logic (Views or UI) from the core business logic part of the application, for example using the UnityMvvmToolkit package.
Well, the workflow I show here is all about building interfaces as a programmer. It assumes you're not working in a team on the ui. Using the typical workflow of ui (with the builder), mvvm could work nicely.
@@Tarodev Yes MVVM works better with declarative UIs/XML based interfaces (Microsoft's XAML, Android's AXML or in this case Unity's UXML), and everything is glued with Data Binding. What you did in this video is close to MVU (without the state management/U part). I'm really thinking about creating a full MVU implementation for UI Toolkit for my next project, where it'll be really easy to build UI and manage state, something like: readonly State clickCount = 1; readonly State text = "Hello World"; private void Generate() { Body = () => new VisualElement { new Text (text, "text-title"), new Button("Update Text", "btn-primary", () => text .Value = $"Click Count: {clickCount.Value++}") }; I already made a POC and it works very good, it even works really well with Unity Hot Reload package for now. I intend to share it with the community when I finish it and if it turns out good.
Best class on this topic so far! It's been pretty hard to find more about UI Toolkit, mainly in Custom Editor Windows, so thank you very much for this video.
Great Video! Might have been a bit fast paste but there is a pause and rewind button for a reason (: I've been needing to learn UI Toolkit for a while now and saw you posted this. I was board and said whelp lets do this! So thanks for getting me to finally learn this it was great and this is so much better than old UI lol, Have a great day or night man!
Amazing video, as always! Been hesitant to use the UI Toolkit, but now I might give it a try! :) P.S. For the sake of the video tutorial, I find co-pilot to be annoying. It's hard to follow when blocks of code just pops up. Way easier to follow when you write+say what you are writing. Just a tip from a filmmaker and fellow coder! Keep up the great work! Cheers! 🍻☺
Thank you so much for the great explanation of why you are doing things. I was watching another video of someone making a healthbar and he just told you what to do but nothing about why he was doing that.
Another easy way to have it update in edit mode is to create a button in the editor with the Generate() method. If you have OdinInspector it's really easy, just add [Button] over it.
I really liked how you simply explained everything in such a short time. God bless you. But I also need to personally think about how to write your version for my own style code. I'm a KISSEnjoer, which you managed to follow for the most part 💘
I'd recommend downloading the Unity demo 'Dragon Crashers' just to see a completed UI and test whether you have performance issues using it. Saw an older video on UIT showing a lot of lag. My PC seems ok with it but YMMV
Have you completely stopped using the old UI management in favor of using UI Toolkit? Is there anything in the old way that UI Toolkit lacks? Also thanks for another great tutorial. All your videos are really informative and well put together
Ui toolkit takes longer to setup, so if I just need to put text on a screen for a video, I'll use the old system. For an actual game though, I'll use ui toolkit. Although a few caveats... Shaders are not supported for another year at least. World canvases are also not supported right now.
Feels bad that I have been working on my game's UI for 2 weeks just to see an easier way to do it :,) I was reading about Layout Groups and how expensive they are when it comes to performance, and this looks like the best way to have control over a flow of elements within a container in a performant way
Same here, kind of. Had an OK UGUI. Disabled it in favour of UIT... Tried for 2 days, gave up. Tried UGUI again for a day.... then Tarodev comes along and now I'm back on UIT. :| Annnnnnnd nothing's progressed in 5 days now.
This is awesome, thanks for the tutorial, I never know that UI Toolkit had tween. I would like to move completely to UI Toolkit but DOTween don't have shortcut to tween UI Toolkit. Also world UI seems need to use render texture when using UI Toolkit 😢
Nice brief tutorial about basic use of the UI toolkit! I have question tho, does the UI adjust dynamically with the device resolutions? says I want to develop for androids and pc, do I have to adjust the stylesheet for each device resolutions?
Great tutorial! The number 1 thing that I really want to know is how to make the UI scale like the canvas do. You know, make it scale uniformly on either the X Or Y Axis, instead of just stretching to the screen. I have looked everywhere and not found anything on it yet.
Ui documents use a shared asset file called 'panel settings', which is created for you when you add your first ui document. In there you can control how it scales. It even gives you a slider which let's you favor height or width when scaling 😊
I havent looked at UI toolkit for ages, so i found myself here, but one thing i will say, your comment on copilot is spot on.. its like having a twin whos you but you borg like share the thoughts
How? Why? I started to use UI Toolkit 3 days ago. Trying to make it work. I just figure it all out and THEN you publish a video about it? A month since last vid? Still thank you for this fantastic video! I still want more form you!
How close is your technique to what I show here? I listed three workflows here, but honestly there are a few more I can think of. Quite a complex beast.
While i love this tool so many UI's use that empty unreal blackbox transparent design its the same one thats been around since borderlands 2 Though I am so happy to have a tool that just makes scaling easy!
HA! You've been building up to this video in some capacity for like 9mths+ haven't you? A day or two ago, I saw a comment from you elsewhere on YT vid about UIT, and you identified the issue with strings there. After a couple days of trying UIT I gave up on went back to UGUI because I couldn't get an image to scale uniformly with different resolutions. Maybe I was doing it wrong in hindsight. Or ascribed more functionality to UGUI than actually exists. But now that there's a *Tarodev* tutorial on it (and maybe more to come?) I guess I'll be giving it a second try.
Nice one. Is there a way to avoid the hard coding of the class styles? e.g. "bordered-box" shows up a couple of times in the C# script but also in the uss style sheet
It's a nice tutorial, but I'm wondering ,we're doing too many string-type assignments here like "red-boy", wouldn't they be a problem in terms of performance?
Hey Taro, managed to make the ui work, i actually converted the variables set up in the coroutine as private variables in the script so i could access them and update them at runtime by events for things like healthbar and manabar for the player. Seems to work well now. Undortunatelt dowsnt seem like we can use this fkr worldspace ui though so healthbars over monsters isnt easy or possible to do for now.
UI toolkit may be good for medium or large size project, but man, many of these "new" Unity tools seem to be aimed towards teams, not individual devs, I simply want to get things done, but the UI Toolkit, new Input system ... - all these requires considerably more boilerplate and setup to get something on screen, takes the fun out of doing some small stuff whenever you have time.
Great tips, thank you! Btw I would like to buy you a new hat. NYY is uncool -- and not just because they're having a bad season. How about the Brisbane Bandits, the Doosan Bears, or the Tokyo Swallows?
@Tarodev I have a question about hierachy when using this building technique. Lets say I have some containers on my root (canvas). Now I would like to add more visual elements to a specific container but using a different script. For example a container shows several info like the inventory or data from players. So when I try to instantiate other scripts on a certain container refering to this container as root is not that simple. And another issue is that the container needs to be instantiated first. I hope thats not too confusing. Thank you!
How to change the size of Tab Icon in TabView in Unity 2023.2.0f1? I am having a problem using Unity UI Toolkit. I don't know how to change the size of the Tab icon. I searched for relevant materials and documentation, but I couldn't find any. I need help, thank you!
The thing i don't like about this is that the cube is not part of the UI. For example if i have a level builder of some sort and i want all my model to be visible in my UI to pick from, moving the camera around would fuck things up. Sorry if i don't explain well what i mean but eng is not my lang
Upon leveraging a coroutine for the Generate function my build now has about a half second delay from when the game scene starts and when the U is constructed. This results in an very noticeable and ugly "flash" in which the U suddenly appears. How do you go about eliminating this lag? I removed the coroutine part and just check if the root is null before continuing with the rest of the generate function. Some debugging revealed that the root was only ever null coming from the OnValidate part, but it never happened to me (so far) when invoked from Start. While I'm sure that a coroutine would be nice for some deferred UI rendering logic I'm not so sure it's defacto-best practice with this particular UI generation style.
I'm talking to you right now on discord 😊 but for everyone else: UI toolkit has a canvas scaler equivalent, as well as a slider to prioritise width or height. It's very sleek
i dont really get how i can make the ui look good, am i stuck with the rendering of the ui how can i use custum icon for buttons and stuff? or even the slider. it looks bad, is there a way to have an artist stylized it?
Man, tarodev's tutorials are the best. I like how he teach us an actual good way of doing things not like other game development channels....
Yeah exactly, i've said the same thing elsewhere. Like, people with official Unity affiliation/partnership or whatever publish terrible tutorials because the content has no real world use or are horrifically non performant or unmanageable. You follow the others tutorial and yeah, it works, but its not until then that you realise its not something you can ever actually use. It's just a lesson on how not to do something most of the time.
And even if you're not going to use a specific thing in Tarodev's vids, you will almost always learn something useful generally.
Tarodev took a timemachine from the future back to this date just so he could keep his tutorial posting consistency for us. What a lad.
Lol
Just like that - the most detailed, practical and in-depth tutorial on the new UI toolkit that exists. Yet again: thank you Tarodev
As an alternative workflow to using OnValidate, you can do the following:
1. Create a script and name it 'MainMenuScreen', deriving from VisualElement. Add the following 'UxmlFactory' code to have it expose in the UI Builder (docs.unity3d.com/Manual/UIE-expose-custom-control-to-uxml.html).
2. Create a UIDocument file and drag your exposed MainMenuScreen control into the view.
3. Drag the UIDocument file into the source asset of the UIDocument component.
Now your changes in MainMenuScreen script will reflect just as OnValidate would.
Also, here's a 1-minute video about UI Toolkit responsiveness: th-cam.com/video/xbEcynEnKLI/w-d-xo.html
The link to the Unity docs accidentally had the right parenthesis included in the URL, removing that will take you to the proper page.
and when the world needed him the most ... he returned !!! Thanks for that video I'll consume it later !
I am a simple man,
I see gamer girl in thumbnail,
I click
Noice tut tho!!
on a more serious note,
If unity adds a "standard apps" Update loop (things are not re-drawn every frame) then it can be a very powerful non-game apps tool.
Unity actually already is a very powerful non-game tool, especially if you're doing anything like simulation or visualization. If you'd like to manually control update cycles for your scripts you could already use FixedUpdate, though often times an event pattern is more robust for those kinds of applications.
Anything that you'd be simulating would probably have to be updated every frame anyway.
Am not talking about script updates, am talking about frame re-draws.
Also. yes for anything that require 3D or simulation, unity is great for non-games apps, but imagine doing something as simple as a " calendar app" (yes, why use unity for that) but let's supposed its a very typical calendar app, but it has a total different scene where you can see super cool 3D achievements.
For the achievement scene, the way unity render things make total sense (re-draw every frame)
But for the Calendar part, a more traditional way is crucial, otherwise you will have a Calendar app that drains battery with the same rate as a Game, which is unacceptable.
Godot for example offer a solution where the UI only ger re-drawn if a change happens.
if you open the youtube app and stay in the homescreen for 2 hours without anything moving (not even video previews)
it will consume less battery than opening a unity mobile game with only one single sprite in the scene.
I had a hard time creating an UI for a project using only C#. Thanks so much for this tutorial, it will help me a lot!
Perfect timing, I needed a good tutorial on this for a project. You're a savior.
As a frontend web developer in my professional life, this makes so much more sense to me. Now we’ll see if I can figure out a way to make reusable components like React in the Unity Toolkit. I’d be unstoppable.
Thank you so much for the tutorial, this helped immensely! My biggest blocker was figuring out a better way to add functionality than the way their sample project does it, with a million string ID queries.
Reusable components is a cakewalk! Checkout my Tarodev repo on git. I also built a scss/less/stylus -> uss compiler plugin.
This tutorial is so sweet to watch, I love the way you present the pro way to use UI-Toolkit and your confidence.
Use UIDocument instead of programmatically. This video is completely defeating the purpose of UIDocuments. Separate, model view and presentation, which are c#, uxml and uss respectively here…
Thank you for showing off this workflow! The "recommended" workflow is honestly unbelievably bad for larger scale projects but I resigned myself to using it before seeing this and realizing I could just write extensions and factory methods to make building UI through C# much more readable.
Great tutorial! Was meaning to learn this and your thumbnail and showcase hooked me haha
Easy to understand and follow keep up the great work 👍
Clickbait successful.
@@Tarodev Saw your channel logo and thought I was getting some tasteful chibi hentai. Now I'm trying to code a game.
th-cam.com/video/9tqet1rQw5k/w-d-xo.html help me unity keeps crashing on creating any kind of new project in any version of unity whether it's new, old or LTS...
Thank you so much for this. I've been going through the official documentation but couldnt really wrap my head around it. This showed me everything I needed to know. Thanks
Mate, I know jack all about this stuff. But listening to your clear and coherent explanations of what you're doing and why, makes it a really easy listen while learning something that I'm sure many people are looking to learn. Thanks for the awesome vids.
I appreciate the kind words mate 😊 thanks for watching even when you didn't need it ❤️
I enjoy using the UI toolkit, but there have been some parts that felt a bit unclear to me. I really appreciate that you've covered most of them.
i was littrely thinking of making new UI to my game and u posted this vid lol, thanks a lot!
Great video as always, I have been very interested in this package since it was announced but mostly for Editor use. Even tho I do find it very useful for editor UI, I do think it's a bit weird to use for runtime UI (at least in its current state). And from what I could find the recommended way for runtime UI is still Unity UI (I would have left a link to the page but it seems like I cant let a comment with a link inside it) at least for the moment.
This is the best tutorial for unity's UI toolkit on the entire internet
I love using the ui toolkit but some parts have been kinda shady for me, love that you have covered most of them
Amazing - this is the way to do it like a pro. Hope you will continue the tutorials with UI Toolkit.
What do you think about using the UI Toolkit with the MVVM architecture pattern? The UI Toolkit is most suitable for this purpose, and you can easily separate the data presentation logic (Views or UI) from the core business logic part of the application, for example using the UnityMvvmToolkit package.
Well, the workflow I show here is all about building interfaces as a programmer. It assumes you're not working in a team on the ui.
Using the typical workflow of ui (with the builder), mvvm could work nicely.
@@Tarodev Yes MVVM works better with declarative UIs/XML based interfaces (Microsoft's XAML, Android's AXML or in this case Unity's UXML), and everything is glued with Data Binding. What you did in this video is close to MVU (without the state management/U part). I'm really thinking about creating a full MVU implementation for UI Toolkit for my next project, where it'll be really easy to build UI and manage state, something like:
readonly State clickCount = 1;
readonly State text = "Hello World";
private void Generate() {
Body = () => new VisualElement {
new Text (text, "text-title"),
new Button("Update Text", "btn-primary", () => text .Value = $"Click Count: {clickCount.Value++}")
};
I already made a POC and it works very good, it even works really well with Unity Hot Reload package for now. I intend to share it with the community when I finish it and if it turns out good.
Best class on this topic so far! It's been pretty hard to find more about UI Toolkit, mainly in Custom Editor Windows, so thank you very much for this video.
You're most welcome and I'm glad you enjoyed 🙂
Great Video! Might have been a bit fast paste but there is a pause and rewind button for a reason (: I've been needing to learn UI Toolkit for a while now and saw you posted this. I was board and said whelp lets do this! So thanks for getting me to finally learn this it was great and this is so much better than old UI lol, Have a great day or night man!
*fast paced
Amazing video, as always! Been hesitant to use the UI Toolkit, but now I might give it a try! :)
P.S. For the sake of the video tutorial, I find co-pilot to be annoying. It's hard to follow when blocks of code just pops up. Way easier to follow when you write+say what you are writing. Just a tip from a filmmaker and fellow coder!
Keep up the great work! Cheers! 🍻☺
Thank you so much for the great explanation of why you are doing things. I was watching another video of someone making a healthbar and he just told you what to do but nothing about why he was doing that.
Glad you liked the format 😊
oh man taro delivers just when I needed it!
Another easy way to have it update in edit mode is to create a button in the editor with the Generate() method. If you have OdinInspector it's really easy, just add [Button] over it.
I really liked how you simply explained everything in such a short time. God bless you.
But I also need to personally think about how to write your version for my own style code.
I'm a KISSEnjoer, which you managed to follow for the most part 💘
Cool, finally this video will push me to transition to UI toolkit.
Amazing video as always
Very cool tutorial--also it was fun watching you zip through this stuff.
Perfect introduction into UIToolkit. Guess I have no excuse for avoiding switching from Canvas now xD
I'd recommend downloading the Unity demo 'Dragon Crashers' just to see a completed UI and test whether you have performance issues using it. Saw an older video on UIT showing a lot of lag. My PC seems ok with it but YMMV
I don't know what's happening, yet. But I'm here for it!
Oh and what exactly brought you in, Rico? The thirst for knowledge?
tardev back with the thristy thumbnails
Keep up the good work my man.
"Copilot is inside my head" Tarodev (Aug 30, 2023)
Love it.
It scares me sometimes
Cool introduction. I really hope Unity figures out databindings at runtime soon, that would solve a lot of magic string issues.
Thank you! Awesome jump start video 🙏
Goddamn I JUST upgraded my project to 2022.3 and wondering how UI Toolkit works. thanks, man!
UIT currently in a weird place btw. It will be a properly supported feature in Unity 2023 LTS I understand. But not touched until then.
I always thought treating unity UI like it's web is a great idea, now it's reality!
Have you completely stopped using the old UI management in favor of using UI Toolkit? Is there anything in the old way that UI Toolkit lacks?
Also thanks for another great tutorial. All your videos are really informative and well put together
Ui toolkit takes longer to setup, so if I just need to put text on a screen for a video, I'll use the old system. For an actual game though, I'll use ui toolkit.
Although a few caveats... Shaders are not supported for another year at least. World canvases are also not supported right now.
Thanks for the new video Sifu! :)
Feels bad that I have been working on my game's UI for 2 weeks just to see an easier way to do it :,)
I was reading about Layout Groups and how expensive they are when it comes to performance, and this looks like the best way to have control over a flow of elements within a container in a performant way
Same here, kind of. Had an OK UGUI. Disabled it in favour of UIT... Tried for 2 days, gave up. Tried UGUI again for a day.... then Tarodev comes along and now I'm back on UIT. :|
Annnnnnnd nothing's progressed in 5 days now.
This is awesome, thanks for the tutorial, I never know that UI Toolkit had tween. I would like to move completely to UI Toolkit but DOTween don't have shortcut to tween UI Toolkit. Also world UI seems need to use render texture when using UI Toolkit 😢
Damn... That's a really great in-depth tutorial.
I'm here for Taropoints.
1 taropoint has been allocated to your account
o_o'@@Tarodev
@@ZOMGbies One point for you too!
One thing that's kinda got me stuck, the documentation isn't that clear. How do we add our own fonts and set them in the .uss files?
I'm here for the hot wifus and I suppose also the good unity tips ;)
Wow, I would like to try this.
Nice brief tutorial about basic use of the UI toolkit! I have question tho, does the UI adjust dynamically with the device resolutions? says I want to develop for androids and pc, do I have to adjust the stylesheet for each device resolutions?
Thanks! This was very helpful, but is there a way to add hover logic on there? Like playing a sound on hover or something? button.hover isnt possible
Great tutorial! The number 1 thing that I really want to know is how to make the UI scale like the canvas do. You know, make it scale uniformly on either the X Or Y Axis, instead of just stretching to the screen. I have looked everywhere and not found anything on it yet.
Ui documents use a shared asset file called 'panel settings', which is created for you when you add your first ui document. In there you can control how it scales. It even gives you a slider which let's you favor height or width when scaling 😊
UI toolkit looks very interesting, but I tried it and I guess it's updating very often that I can't rely on it yet
I havent looked at UI toolkit for ages, so i found myself here, but one thing i will say, your comment on copilot is spot on.. its like having a twin whos you but you borg like share the thoughts
Another banger tutorial 🍻
Awesome stuff, great tutorial, I was worried whether UI Toolkit can do any tweening animations.
a NEW Tarodev video?? woooo!
This just earned a subscribe from me. Very awesome tutorial.
U did really good in the 5devs video haha
Which one? I've done a few now 😅
@@Tarodev every time u were there haha
Thank you for this, Taro
Amazing video! thanks!!
Your tutorials are so good man. straight to the point. love it!
excellent tutorial, thank you so much!
No... Thank you
How? Why? I started to use UI Toolkit 3 days ago. Trying to make it work. I just figure it all out and THEN you publish a video about it? A month since last vid?
Still thank you for this fantastic video! I still want more form you!
How close is your technique to what I show here? I listed three workflows here, but honestly there are a few more I can think of.
Quite a complex beast.
While i love this tool so many UI's use that empty unreal blackbox transparent design
its the same one thats been around since borderlands 2
Though I am so happy to have a tool that just makes scaling easy!
Big return!
HA! You've been building up to this video in some capacity for like 9mths+ haven't you? A day or two ago, I saw a comment from you elsewhere on YT vid about UIT, and you identified the issue with strings there.
After a couple days of trying UIT I gave up on went back to UGUI because I couldn't get an image to scale uniformly with different resolutions. Maybe I was doing it wrong in hindsight. Or ascribed more functionality to UGUI than actually exists.
But now that there's a *Tarodev* tutorial on it (and maybe more to come?) I guess I'll be giving it a second try.
it feels almost like making costum editor window in Unity. visual elements and other stuff. cool. i like it. not much to relearn
Great awesome video tutorial!
I wonder what's more helpful for feeding the 'rythm? Posting 2 comments, or sharing the video somewhere? 🤔
It's cool make a editor UI with it 🔥
Nice one. Is there a way to avoid the hard coding of the class styles? e.g. "bordered-box" shows up a couple of times in the C# script but also in the uss style sheet
HE'S BACK
great video man, hella useful!
This is a godsend
It's a nice tutorial, but I'm wondering ,we're doing too many string-type assignments here like "red-boy", wouldn't they be a problem in terms of performance?
Can you use this new UI toolkit to create world space UI?
Brilliant as always. Thanks Taro! Does the tweening support easing functions? Also is there an equivalent of scss?
Why are there dashes before the var --border-width ?
How is your changes reflected on the editor after you change the code. I need to re focus on the unity editor and need a asset refresh.
Hey Taro, managed to make the ui work, i actually converted the variables set up in the coroutine as private variables in the script so i could access them and update them at runtime by events for things like healthbar and manabar for the player. Seems to work well now. Undortunatelt dowsnt seem like we can use this fkr worldspace ui though so healthbars over monsters isnt easy or possible to do for now.
Nice video. How would you do drag-and-drop in this UI framework?
UI toolkit may be good for medium or large size project, but man, many of these "new" Unity tools seem to be aimed towards teams, not individual devs, I simply want to get things done, but the UI Toolkit, new Input system ... - all these requires considerably more boilerplate and setup to get something on screen, takes the fun out of doing some small stuff whenever you have time.
Great tips, thank you! Btw I would like to buy you a new hat. NYY is uncool -- and not just because they're having a bad season. How about the Brisbane Bandits, the Doosan Bears, or the Tokyo Swallows?
Came to learn about UI Toolkit. Left with Copilot.
@Tarodev I have a question about hierachy when using this building technique. Lets say I have some containers on my root (canvas). Now I would like to add more visual elements to a specific container but using a different script. For example a container shows several info like the inventory or data from players. So when I try to instantiate other scripts on a certain container refering to this container as root is not that simple. And another issue is that the container needs to be instantiated first. I hope thats not too confusing. Thank you!
How to change the size of Tab Icon in TabView in Unity 2023.2.0f1? I am having a problem using Unity UI Toolkit. I don't know how to change the size of the Tab icon. I searched for relevant materials and documentation, but I couldn't find any. I need help, thank you!
I remember it being impossible to write custom shaders with UI Toolkit which was enough of a negative to go back to UGUI. Is this still the case?
Could you please explain how to set up the .uss file extension to work in VS Code? I see that it works in Rider from above video.
thats how to do it! i am programmer, not game developer (yet). how do you add an texture/image/icon to an element eg. button via code?
Dont understand how works the new UI. I added a Progress bar and i cant modify any of the style properties of the child objects, all are greyed out
With this method, how do we toggle among UIs?
How can we change the cube in the project file back to a character 3d prefab, with animation?
Message me on patreon :)
The thing i don't like about this is that the cube is not part of the UI. For example if i have a level builder of some sort and i want all my model to be visible in my UI to pick from, moving the camera around would fuck things up.
Sorry if i don't explain well what i mean but eng is not my lang
Upon leveraging a coroutine for the Generate function my build now has about a half second delay from when the game scene starts and when the U is constructed. This results in an very noticeable and ugly "flash" in which the U suddenly appears. How do you go about eliminating this lag? I removed the coroutine part and just check if the root is null before continuing with the rest of the generate function. Some debugging revealed that the root was only ever null coming from the OnValidate part, but it never happened to me (so far) when invoked from Start.
While I'm sure that a coroutine would be nice for some deferred UI rendering logic I'm not so sure it's defacto-best practice with this particular UI generation style.
Can you direct me to a resource which explains why when you add "scale" to your button style class, it animates the value? Mine does not animate.
Ensure you have a transition property.
.thing{
transition: all 0.5s ease-in-out-sine;
scale: 1;
}
.thing:hover{
scale: 1.5;
}
Tarodev sure knows how to attract programmers lmao
Hey, what about differente screen sizes, does it handle well?
I'm talking to you right now on discord 😊 but for everyone else:
UI toolkit has a canvas scaler equivalent, as well as a slider to prioritise width or height. It's very sleek
i dont really get how i can make the ui look good, am i stuck with the rendering of the ui how can i use custum icon for buttons and stuff? or even the slider. it looks bad, is there a way to have an artist stylized it?
How did you get Rider to recognize USS files? I'm getting inspector errors on things like the :root selector, using %, etc
I had to ignore those warnings. I actually submitted a ticket to rider suggesting a few uss improvements, so we will see how it goes