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

preview_player
Показать описание

In this Unity tutorial, you'll learn about Unity's handy Selectable interfaces (like ISelectHandler, IPointerEnterHandler, etc) and how to utilize these to create custom UI animations. After that we'll look at how to handle things like swapping control schemes mid-UI screen and how we can still seamlessly navigate around.

Link to Download our FREE 2D Asset Pack:
---
---

Unity Selectable Documentation:

Unity Free Cards on the Asset Store

Contents of This Video: ------------------------------------------

00:00 - Intro
01:31 - Different Interactable Transitions
02:29 - Creating a UI animation with code
04:28 - Adding Selectable Interfaces so we know when the card has been selected
06:33 - Adding Controls for Gamepad or Keyboard
08:40 - Tracking which object should be selected with gamepad
09:54 - Setting Up UI Input controls
10:42 - Finishing up

Who We Are-------------------------------------

If you're new to our channel, we're Brandon & Nikki from Sasquatch B Studios. We sold our house to start our game studio, and work full time on building our business and making our game, Veil of Maia.

Wishlist our Games:
Wishlist Samurado!

Don't forget to Subscribe for NEW game dev videos every Monday & Thursday!

Follow us on Twitter for regular updates!

#unitytutorial #unity2d #unity3d
Рекомендации по теме
Комментарии
Автор

YES! please make a series called (Like a Commercial Game) THIS IS SOOO HELPFUL!

Astrouia
Автор

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.

legendaryswordsman
Автор

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)) { } 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.

Soraphis
Автор

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!🎉

DiabloGoldSecrets
Автор

Fantastic tutorial. Fast paced but easily understandable. Thank you!

GamingJadenWilliams
Автор

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).

vazzius
Автор

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

NoTimeLeft_
Автор

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!

Keywarn
Автор

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

caradepeido
Автор

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.

marularch
Автор

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.

MiniatureGiantsGameDev
Автор

The quality of this tutorials is astonishing

BarcelonaMove
Автор

literally getting back into unity and this was exactly what i needed, thanks man.

shi_
Автор

Wow I've been waiting for that video for years !

-Engineering-
Автор

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

stropheum
Автор

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!

udadni
Автор

19 seconds in the video I already liked and followed you. Just that one sentence resonated so hard :, D

KolmeGurua
Автор

Wow! This is the best tutorial in its category!
Thanks, so helpful. Oh, and great channel, btw!

kimen
Автор

im just getting into coding and damn man the way your just throwing this code together is wild.

chrispollard
Автор

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.

melpermo