No video

Handle UI Like a Commercial Game (Custom Animations + Different Control Schemes) | Unity Tutorial

  Рет қаралды 52,874

Sasquatch B Studios

Sasquatch B Studios

Күн бұрын

Пікірлер: 78
@Astrouia
@Astrouia Жыл бұрын
YES! please make a series called (Like a Commercial Game) THIS IS SOOO HELPFUL!
@lecomingbegend497
@lecomingbegend497 3 ай бұрын
This should be pinned
@Soraphis91
@Soraphis91 Жыл бұрын
4:15 using lerp without a fixed starting point, will make it never reach the actual end-value. either store your start values before the while loop or use MoveTowards or something like that 5:35 instead of right-click > quick actions you should also be able to just hit [alt]+[return] 5:55 null it only if the current selected value is the current object. 7:20 singleton is really unnecessary here since you know you will have a parent/child relationship between the objects anyways. so you're just polluting the project with a unnecessary singleton, with all the drawbacks they have. 10:50 if(! Mathf.Approximately(InputManager.instance.NavigationInput, 0)) { HandleNextCardSelection(Mathf.Sign(InputManager.instance.NavigationInput)); } would be a more compact version of the update method that does the same I guess that you need to wait a frame, because the children are not always setup yet, when the code goes through this.
@legendaryswordsman2279
@legendaryswordsman2279 Жыл бұрын
UI is it's own beast especially when you start adding gamepad support lol. Now I know no one reading this knows me but I'm gonna share this here anyway, I've had to go through these same struggles with my projects and I've had to create my own solutions for them, and I'm extremely proud to be able to say that I've been able to overcome these difficulties without the need of any video tutorials, hell even a year ago I wouldn't even know where to start with this lol.
@triplezgames3882
@triplezgames3882 11 ай бұрын
Nice, good job
@DiabloGoldSecrets
@DiabloGoldSecrets 3 ай бұрын
As someone who has published dozens of games on xbox360 and steam but never had a huge success (360 I had a games with 100,000 downloads, and on steam as many as 5k sales for a single game), this is the kind of content I need to help understand how commercial developers think about the little things that take your game to the next level. Thank you!🎉
@GamingJadenWilliams
@GamingJadenWilliams 6 ай бұрын
Fantastic tutorial. Fast paced but easily understandable. Thank you!
@NoTimeLeft_
@NoTimeLeft_ Жыл бұрын
This is quality stuff. After years of watching tutorials and even having a degree in Computer Science, I can confidently say this is the sort of thing every dev should learn and many of these programming concepts are being put into our upcoming project No Time Left
@vazzius
@vazzius Жыл бұрын
Overall great stuff! You could use the new Input System to detect when a controller takes control of the input to reselect the last selected object by using the OnControlsChanged method in your Input Manager or another component that is in the same component of the Player Input. You could also use the Selectable navigation system on the button component so you don't need to manually control the selected button when pressing the directions (the arrows at 1:43 in the scene view show how the navigation would be).
@caradepeido
@caradepeido Ай бұрын
Such a refreshing video in the unity tutorial space of youtube! I find that a majority of the videos are made by unity/programming hobbyists and therefore disregard basic coding principles and background knowledge that you displayed here :) thank you
@Keywarn
@Keywarn Жыл бұрын
Video couldn't have come at a better time. We were just about to start adding menus and UI to our prototype. We really want to support gamepads and kbm from the start, thanks for this!
@BarcelonaMove
@BarcelonaMove 3 ай бұрын
The quality of this tutorials is astonishing
@MiniatureGiantsGameDev
@MiniatureGiantsGameDev Жыл бұрын
I saved this video for future reference, which is not something I do very often. I learnt something today - this was a really awesome video. Thank you and great work.
@shi_503
@shi_503 Жыл бұрын
literally getting back into unity and this was exactly what i needed, thanks man.
@-Engineering01-
@-Engineering01- Жыл бұрын
Wow I've been waiting for that video for years !
@KolmeGurua
@KolmeGurua 4 ай бұрын
19 seconds in the video I already liked and followed you. Just that one sentence resonated so hard :,D
@marularch
@marularch Жыл бұрын
I was actually trying to solve this same problem for my game UI. I eventually deleted mouse navigation because I don't need it for gameplay but this tutorial might be very helpful for a future project. Thanks a lot.
@stropheum
@stropheum 6 ай бұрын
your race condition is based on script execution order + Awake. Since OnEnable is also called when Awake is invoked, if your script executes before EventSystem's Awake is invoked, then your script will crash. A simple way around this I've found is just setting a flag in your script that gets set to true on awake, and short circuit OnEnable if that flag isn't met. It's technically safer and more correct than using a coroutine to wait one frame, though it accomplishes the same thing
@kimen1
@kimen1 Жыл бұрын
Wow! This is the best tutorial in its category! Thanks, so helpful. Oh, and great channel, btw!
@realprodigious
@realprodigious 3 ай бұрын
If you'd like to do everything he did but in a must faster, more efficient way, look into a tweening library. It gives you so many tools to make animations for both UI and objects. Once you get familiar with a tweening library and you understand how it works, it's benefit really starts to shine through
@chrispollard2898
@chrispollard2898 3 ай бұрын
im just getting into coding and damn man the way your just throwing this code together is wild.
@sakeb1
@sakeb1 3 ай бұрын
yeah he is super fast, comes with experience
@melpermo
@melpermo Жыл бұрын
As always, great video! Thanks a lot. I was preparing the ui for a small project, and the video has made me rethink some things which I hadn't forgotten to keep in mind. Thanks, so helpful.
@radiance_37k
@radiance_37k Жыл бұрын
You just earned yourself a new sub. Really liked the video. Keep up the good work.
@globes179
@globes179 8 ай бұрын
Nice work sir, please keep keeping on!
@udadni
@udadni 6 ай бұрын
Thanks for the great tutorial! I was just implementing something similar in a project I'm working on and my solution was very sloppy. Looking forward to trying it this way!
@regys9521
@regys9521 10 ай бұрын
Mind blowing!!! awesome content to say the least
@Indolen_s
@Indolen_s 2 ай бұрын
This is great video!
@midniteoilsoftware
@midniteoilsoftware Жыл бұрын
Superbly done Brandon!
@SurfBit
@SurfBit Жыл бұрын
Your videos are really helpful bro! +1 sub
@DanPos
@DanPos Жыл бұрын
Awesome tutorial :)!
@pocket-logic1154
@pocket-logic1154 Жыл бұрын
Excellent info. Thank you!
@tientam779
@tientam779 Жыл бұрын
Great tutorial, subscribed!
@Lazzarus7
@Lazzarus7 Жыл бұрын
Great tutorial and to the point, thank you!
@fatabi95
@fatabi95 Ай бұрын
Amazing thanks a lot !
@GBSCronoo
@GBSCronoo Жыл бұрын
OMG, more like this please!
@sasquatchbgames
@sasquatchbgames Жыл бұрын
Glad you liked it!
@Thesupperals
@Thesupperals 9 ай бұрын
I hate to say it, but I think there is a huge difference in which kind of quality one would typically be aiming for. For example: is it AAA, or is it stylized? Is it indie dev or a huge team? The code is without debate, but this core situation is about everyone doing nothing good for UI. Hell, even I struggle. It is just so difficult to make UI look good when you can definitely make UI functional.
@snooksv3172
@snooksv3172 7 ай бұрын
Good vid, but using Update instead of a Coroutine is more performant if you have many btn elements. Something to keep in mind.
@tianqigao869
@tianqigao869 Жыл бұрын
awesome tutorial!
@MacMiggity
@MacMiggity Жыл бұрын
This is really good, even for a professional mobile game dev :P
@zacharysilverzweig7715
@zacharysilverzweig7715 Жыл бұрын
Really awesome content.
@kardrasa
@kardrasa Жыл бұрын
you really type that fast? daym!
@Chris-lw5po
@Chris-lw5po 6 ай бұрын
No. It is sped up and you can hear it by the pitch of the keyboard clicks.
@BrandonNyman
@BrandonNyman 10 ай бұрын
This does not appear to work if the element being animated is on any layout group. It will just move to the bottom left corner and then behaves fine after that but in the wrong location. And each UI element will then stack on top of each other. This is fine if the element is not in a layout group.
@dunkeshon2309
@dunkeshon2309 5 ай бұрын
Can you please make a tutorial on “new input system” And how to use it properly like in commercial game. I tried multiple times to digest it, but with no effect. These docs are very vage and tutorials are as you said, suitable only for game jam type of games, but in this case easier to stick with the old one
@masoncrowe
@masoncrowe Жыл бұрын
Great video!
@viraj3944
@viraj3944 5 ай бұрын
Can we attach this script to our canvas instead of the cards?
@bananaboyTS
@bananaboyTS 9 ай бұрын
My VsCode doesnt show the error when the interface methods are not implemented. kinda annoying
@nickjunes
@nickjunes 23 күн бұрын
Ok but what is this 'f' unit type and what are these variable types "SerializeField" and "Range" and how can you have 2 variable types for one variable?
@sajadtroll9186
@sajadtroll9186 Жыл бұрын
3:00 Coroutines are your friend 😂
@iiropeltonen
@iiropeltonen Жыл бұрын
Good stuff!
@grzesfu
@grzesfu Жыл бұрын
I feel like there must be another way than reimplementing navigation "manually" in Update. I'm almost sure there's some callback when unity switches control from the mouse to keyboard/gamepad, and we could somehow intercept the event and set EventSystem.current.SetSelectedGameObject() before that event is handled?
@sealsharp
@sealsharp Жыл бұрын
It can be made simpler, if it is okay that the ui-object stays selected. I made myself a "UiKeepControlSelected" script that keeps a ui-object in menu selected when using the mouse on a scrollbar, because mouseover and scrolling deselects the prev. object but does not select a new one. private void Update() { if (EventSystem.current.currentSelectedGameObject == null) { if (this.lastSelected != null) { EventSystem.current.SetSelectedGameObject(this.lastSelected); } } else { this.lastSelected = this.eventSystem.currentSelectedGameObject; } }
@Xiimo_
@Xiimo_ Жыл бұрын
i've been loving these "like a commercial game" tutorials, but i have a question, why would you replace the navigation controls of the default input with your own?
@johnsummers101
@johnsummers101 3 ай бұрын
So, I get the concept of singleton. but what actually makes it that? The code looks the exact same.
@viraj3944
@viraj3944 5 ай бұрын
Why do we need the empty game object?
@mohitKumar-lo5gm
@mohitKumar-lo5gm 3 ай бұрын
can we achieve same by using unity new UI Toolkit
@weks
@weks Жыл бұрын
Awesome tutorial, really nice! Ps: am I the only one that is mildly annoyed that people use startPos, and not position, but don't use startSca instead of startScale? Might be my perfectionism haha
@TheOriginalDuckley
@TheOriginalDuckley Жыл бұрын
To me it seems like pos is more obviously referring to position but sca isn’t as obvious immediately that it is referring to scale?
@sasquatchbgames
@sasquatchbgames Жыл бұрын
Lol! I'm sure you aren't the only one. Doesn't bother me though :D
@MrDarshan2714
@MrDarshan2714 Жыл бұрын
Awesome video but if we use class inheritance that will be more appropriate.
@ezekielswiss4347
@ezekielswiss4347 10 ай бұрын
I really hope you follow up on this tut. I want to make a card game in unity and really need some more help.
@afabulouswhale
@afabulouswhale Жыл бұрын
Hi. I have an issue where the UI seems to glitch and just continuously repeat the animation when hovering over it
@TheCamiCono
@TheCamiCono Жыл бұрын
Nice video! Is it only me that if your mouse is still hovering over a card that it stays highlighted but the selection of an other card does happen?
@sealsharp
@sealsharp Жыл бұрын
Sweet!
@user-jn3of9wb8q
@user-jn3of9wb8q 11 ай бұрын
can you do like that all card are overlap each other and when we move pointer on card it will select as you did but will be in front like slay the spire
@zeon137
@zeon137 Жыл бұрын
The waiting for one frame thing could be because of script execution order?
@opxv
@opxv Жыл бұрын
Hey, thats some high quality tutorial. I have a question though: When I got multiple elements which listen to the same event, how do you manage, which script should handle the event? Example: the three cards get selected with the arrow keys but the game camera moves with the arrow keys too.
@sasquatchbgames
@sasquatchbgames Жыл бұрын
Guess that depends on the situation. You could have a gameState manager that will trigger certain events based on what 'state' your game is in for more complex things. For the simpler example you gave, since I would consider scrolling through cards UI - I would split my controls into 2 action maps, 1 being the game, 2 being the UI. You can disable the game controls and enable the UI controls whenever dealing with UI
@ecenjoyer
@ecenjoyer 8 ай бұрын
why not just use dotween for the animations instead of doing lerps etc, much easier lol tf
@danielj6417
@danielj6417 3 ай бұрын
Often times Unity tutorials don't use plugins to keep things simple. I'm sure Dotween would work great
@Cookinbk
@Cookinbk Жыл бұрын
Hi I am a software engineer in college for IT but I want to also learn game development but I do not not where to start i want to learn python for apps and softwares and C# for games and pc softwares as well I want to start with C# first because i know python is easy and not hard to learn if you know a language already but I want to learn C# for game development and software apps I wanted to know if anyone knew any update courses or tutorials for beginners I do software engineering and also want to do indie game development solo i know that’s hard but I want to try it I really want to be a software engineer and a indie game developer but I don’t know where to start with game design or programming
@sasquatchbgames
@sasquatchbgames Жыл бұрын
If you want to use Unity/C# for game development, Check out Codemonkey's channel. He has a 10 hour free course aimed at beginners (it's one video) and I've heard nothing but great things about it
@RGcrasyRG
@RGcrasyRG 6 ай бұрын
"Handle UI Like a Commercial Game " is pretty bald statement coming from "Me and my wife studio". No offense.
@RGcrasyRG
@RGcrasyRG 6 ай бұрын
The actual content of the video is good though.
@felipezymor9970
@felipezymor9970 5 ай бұрын
If he's making a commercial game, it's an UI just like in a commercial game.
@Coco-gg5vp
@Coco-gg5vp Жыл бұрын
First
How to Start Gamedev in 2024
10:28
Sasquatch B Studios
Рет қаралды 503 М.
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 178 М.
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,6 МЛН
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
Watch This BEFORE making Your First Indie Game!
7:23
Sasquatch B Studios
Рет қаралды 232 М.
Make constant progress in your game using THIS method
9:03
Sasquatch B Studios
Рет қаралды 12 М.
I tried Cuphead’s hardest speedrun
29:45
EazySpeezy
Рет қаралды 63 М.
every step to actually make your dream game (then sell it)
24:27
Handle Scene Transitions, Doors and Persistence like a Commercial Game
24:06
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4 МЛН
Building Runtime UI with UI Toolkit In Unity
21:35
Game Dev Guide
Рет қаралды 38 М.
Recreating Balatro's Game Feel | Mix and Jam
7:21
Mix and Jam
Рет қаралды 52 М.
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,6 МЛН