for anyone who is curious to know, I can confirm that this DOES work with Unity's new INPUT system. I had issues getting it to work with a controller, until I changed my "Active Input Handling" in 'Player' in 'Project Settings' from BOTH to NEW. After this, select your 'Event Handler' and let Unity upgrade it. Works like a charm after this.
@szkokee3 жыл бұрын
I have switched because it didnt work and im getting an error. "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." Then i choosed the options "Both" that made the error go away but all this menu setup still doesnt work.
@kristophia73103 жыл бұрын
@@szkokee go to event system and update it
@vladstefanvulpe61863 жыл бұрын
@@kristophia7310 sorry, how do you update it? i can't figure it out
@kristophia73103 жыл бұрын
@@vladstefanvulpe6186 the input system is having a problem that you still want the old one you can use bolth if there is no bugs
@simonvutov75753 жыл бұрын
Thanks this works very well!! (:
@wmorais19764 жыл бұрын
The best explanation I've seen about UI navigation!
@MesaTheAalfa3 жыл бұрын
agree
@swornimpangeni12862 күн бұрын
Thank you so much. You're a true savior. Searched the whole you tube, nobody explained it better than you.
@fableisticstudio68614 жыл бұрын
Excellent tutorial. There is plenty of information out there about the navigation and "First Selected" in the event system. However, the the scripting aspect is the real gem here. This solved all of the issues I was having with menu navigation.
@mcalageorge73664 жыл бұрын
Bless you man, I've been looking for this for so long. You're awesome
@patrickmorter90974 жыл бұрын
I've never looked into keyboard menus until today, due to being under the impression that they were going to be a lot more complicated than this (due to a previous video I had seen). Watched this video and then implemented a multi-panel in minutes. Nice one!
@Destructivepurpose2 жыл бұрын
Exactly what I was trying to figure out. Hats off to you, sir!
@Hymnal273 жыл бұрын
I really like how you explored the problem before jumping into solutions - thanks for the video!
@pillemarisken2 жыл бұрын
Thanks for the tutorial James! If anyone's having issues with their buttons not animating when the game is paused, go to each of your button's Animator and make sure that the Update mode is set to Unscaled Time instead of Normal. 🙂
@AmalieKae4 жыл бұрын
This was SO helpful, you have no idea! Thank you so much!
@TegridyMadeGames2 жыл бұрын
Such a simple feature, thanks for explaining it.
@UberMassiveGaming3 жыл бұрын
Thanks, recently installed a dialogue system plugin and was surprised that they didn't implement keyboard/controller functionality built in.
@hollowthing32593 жыл бұрын
This is amazing! Not very many tutorials show you how to do these things!
@richardmolina3d3212 жыл бұрын
Thank you, I went from a 900 code line "solution" to this 12 liner... its like GI Joe, knowing is half the battle, and man was I goin the wrong direction
@ariefnugraha2432 жыл бұрын
This is such a 100% Unity moment Thanks for the tutorial tho
@Visuwyg3 жыл бұрын
Thank you, this tutorial had some vital tips in it, even for a Bolt User like me!
@Blake-Lawton-Dev4 жыл бұрын
This is a great follow up video for all your menu videos. Thank you!
@HaydenTheEeeeeeeeevilEukaryote4 жыл бұрын
is there a good way to make it so when you do hover over something with your mouse it switches that button to the selected one as if the control stick moved it there? it’s weird having multiple buttons highlighted at once and depending on the project it can be weird having nothing highlighted when the mouse isnt on anything
@thehailey4 жыл бұрын
You could cast a ray from the cursor, then if it returns a hit on a button make that button the selected button using a script. It would use the same method as you'd use to select units in an rts style game.
@adamwright59804 жыл бұрын
On the button add component>event trigger Then add an event "pointer enter" Drag the button into the event's slot. use the dropdown that says "no function" and choose "Button> Select()" That will make it so that when your mouse hovers over the button it is selected. Using the control stick will navigate the buttons again. Because it's a "pointer enter" event it won't go off again until your mouse leaves the button and comes back.
@HaydenTheEeeeeeeeevilEukaryote4 жыл бұрын
@@adamwright5980 thank you
@Old_SDC3 жыл бұрын
Thanks for the tutorial! Sadly because of how my old menu worked I have to remake the entire thing to use this but 100% worth it.
@martindubois92792 жыл бұрын
damn if you had to remake everything and you followed this tuto sorry to say that but you gotta remake it again soon lol. new input system is a way more powerfull + new ui toolkit is even more powerfull. you no longer need the update function in both case
@koseki_stuff2 жыл бұрын
if you cant scroll through buttons, make sure all your buttons that you want to scroll through have the "automatic" navigation on. i feel like most would have it on none (to account for pc) but if this helps im glad
@junglejim6674 Жыл бұрын
ty sir
@jacobester38464 жыл бұрын
Very good, thanks! I thought I was going to have to program the keyboard/ui interaction from scratch.
@27PhilSnow4 жыл бұрын
Thank you so much for this tutorial! Exactly what I needed :)
@RoryStarks4 жыл бұрын
This is great, very straightforward
@prabdeepdhaliwal82854 жыл бұрын
i love you man, you have very helpful videos!!! very underrated.
@willardpeng59412 жыл бұрын
This is what I really need. Thank You!
@darkmaigo4 жыл бұрын
The best of the bests, thank you so much for this tutorial teacher
@bffever8803Ай бұрын
Thank you for this amazing video
@steveszymczak4486 күн бұрын
4 years late, but i have a question: I have an ability tray in my game (think like WoW RPG style class abilities). For playing with a game pad, I want the player to hit A to switch control over to that ability tray (which is a set of buttons, essentially). How do i do this? Because i don't want to hide the ability tray. I just want to leave it in a non-interactable state until something (player hitting A) activates the button. An example of this and an inspiration for my approach is in Into The Breach.
@baihua-launewbeeКүн бұрын
Thanks! just what i need
@user-rq8hz5lq6h3 жыл бұрын
Thank you sooooooo much this video was really helpful!
@rightanglegames4 жыл бұрын
Just what I needed to know! Thanks for this tutorial!
@JamesArndt Жыл бұрын
I see you also have the double highlight bug where hovering over a button with the mouse does not clear the selected highlight from the keyboard selection. In essence you'll have two green highlighted buttons if you select one and hover over another.
@Zvrra4 жыл бұрын
been always wanting to do this lol
@FlashBreakerOfficial3 жыл бұрын
best UI controll tutorial, thanks you
@LNmaster-ko7wb3 жыл бұрын
But If I Click Mouse I Cannot Navigate Using Keyboard What Should I Do?
@tomasb964 жыл бұрын
Life saver right here! Thank you
@sealsharp4 жыл бұрын
Very helpful. Thanks James!
@sinho113 Жыл бұрын
exactly what i need s2
@NathanPrince12 жыл бұрын
great video, helped me out alot stright to the point with all the infomation needed for the event system. no more making custom menu systems yay :)
@arpatronik5 ай бұрын
at minute 8, why do you first make a SetSelectedGameObject(null) and instantly in the next lane give a value? I mean, it's not the same doing only the second step?
@llibertii2 жыл бұрын
Worked flawlessly!!!
@victorlecam18134 жыл бұрын
Hey, first I want to thank you for your videos that always help me for ... almost everything in gamedev ! I have a problem though with my first button not being highlighted with the event system trick... do you have any clue where it could come from ? Take care and keep it up :)
@kupapapaz6192 Жыл бұрын
you are smarter than chat gpt and u are the best man in the world ı love u
@sherwooddevlog92453 жыл бұрын
You're a lifesaver!
@inkofthedragon Жыл бұрын
I'm trying to implement this with an inventory and equip system. So i can hover over an item which has a button. But how do i get the X button on the controller to register a click on the specific button. Next, how would i trigger an event to call the EquipItem function inside of inventory? Thanks
@oatmealch3 жыл бұрын
I should have watched this before I hard-code all my stuffs!!
@GustavoPLima3 жыл бұрын
thanks man, you help me a lot! "Muito Obrigado" from brasil
@fuselier96384 жыл бұрын
You are a lifesaver
@DrFross094 жыл бұрын
to open the options are we supposed to be using the click() event ( I think he or I ) must have missed that step... I can't find anywhere in the code that fires OpenOptions, so I'm guessing that's ho he's doing it.
@mreimer014 жыл бұрын
Very helpful tutorial.
@mauriciofonseca64046 ай бұрын
Great tutorial!
@my2cents3663 жыл бұрын
Great tutorial, Thanks.
@alivahidi86113 жыл бұрын
Thanks for nice and helpful video
@neenaw4 жыл бұрын
Helped my out a lot, thanks!
@szkokee3 жыл бұрын
I dont understand, the bool values to set the menus active(true/false) on my buttons dont even work if i set them up as code like you. I dont understand how does your work. I have to set them up manually in Unity but then - i guess because of this - the button selection dont translates onto the next menu.
@Curtis_ Жыл бұрын
great video, thank you!
@e4gywanking Жыл бұрын
man's a god
@cosmemartinez1443 жыл бұрын
You just solved all my life!!!! Thanks
@boxitor93554 жыл бұрын
always waiting this
@tudougames864 жыл бұрын
Great tutorial, thanks a lot!
@lomjnkhji2145643 Жыл бұрын
hi, I was trying to select the different buttons of the menu from my controller but it didn't worked
@mwmdragon3 жыл бұрын
Can you record an updated version of this for the new Input System?
@TheOnlyKaas9 ай бұрын
Thank you!
@dylanobrien462 Жыл бұрын
Amazing thanks man
@MikeToth12 жыл бұрын
I have this weird issue, where the navigation with keyboard works fine. It also selects the right button in a new menu. But somehow, it doesn't work with a controller. A can navigate through the menu as with a keyboard, but it doesn't select the first button. So the same code is working with a keyboard, but with a controller not. Respecitvely, the navigation itself does, but the selecting not. Did anyone had this issue as well? Thank you very much
@ZAYMANGAMESTUDIO Жыл бұрын
Me too.
@internetbystander4 жыл бұрын
Thank you for this!
@KENISEG Жыл бұрын
2:11 wtf, HOW? I can't press button via gamepad, just navigate across menu
@14DimensionEnterprise4 жыл бұрын
then, how to move selection between toggles? by keyboard direction keys?
@Clodiosvaldo3 жыл бұрын
Thank you So much!
@XiroNyakuya4 жыл бұрын
Okay now I'm calling the function inside Unity from the On Click() of the Button, but using both lines from the minute 8:00 does not update the Cursor at all. My menu it's working but it does not display any cursor, just the one of the beginning.
@dream_catcher77253 жыл бұрын
is there a way to keep holding the button and keep moving throw the menu like input.getkey in the coding reference but without code (intead of the ui default navigation that look like (input.getkeydown))
@14DimensionEnterprise4 жыл бұрын
I set similar with above with toggles, but not work. no move selection.
@mantavisions23622 жыл бұрын
Amazing thanks!
@leoniest-onge2115 Жыл бұрын
THANK YOU FOR THIS!!!!!!!!
@skrya12483 жыл бұрын
Super useful!
@sledgeweb4 жыл бұрын
If you reply to comments, I echo Hayden's questions... you left a pretty obvious flaw in here, what if the user can use gamepad/keyboard OR mouse (like you are doing in the example video), and the selected object isn't deselected when the mouseover highlights another button - so you end up with multiple highlighted buttons. It happens a few times in your video, so it would be great if you provided a solution for this.
@thehailey4 жыл бұрын
You can use a ray cast from the cursor to update the selected button to the one under the mouse when the mouse is over a button.
@avimalviya2 жыл бұрын
i need that solution too.
@coquetteshadow4 жыл бұрын
Hey thanks alot. This was super helpful;
@MarkStixia4 жыл бұрын
Thank you.
@proximacentauri95092 жыл бұрын
Nice tutorial! But I have a question. How to control a Virtual Joystick of a finished game with Xbox controller? In short, how to move the Joystick without putting your finger on the screen (but the controller instead) ?
@ZAYMANGAMESTUDIO Жыл бұрын
That’s also my concern 😢.
@ZAYMANGAMESTUDIO Жыл бұрын
But what about a game pad? I tried my PS4 joystick and didn’t work.
@sajidgame13214 жыл бұрын
thank you is very nice tutorial
@benjamindehjooriyan64074 жыл бұрын
can you make a tutorial about how to do circular touch ? i want to detect a circle touch to do some lines.
@ZeroTubeTV2 жыл бұрын
Awesome, it works like a charm! :)
@marscaleb2 жыл бұрын
I put in the same code, but when I call that function I wind up not selecting anything. The button itself has an ISelectHandler on it that updates other text on my screen when the button is selected, and that part updates. But the button is not highlighted and I can't navigate between anything.
@JavierCruz122 жыл бұрын
Same problem
@Naakoo_2 жыл бұрын
@@JavierCruz12 Same here
@snigames25 күн бұрын
Thank you very much!!! This worked for my game! That was reallllllllyyyyyyyy awesome and realllllllyyyyyyyyy easy!!
@DanielCenciD2 жыл бұрын
Thanks a lot
@greatgardna25893 жыл бұрын
Tried everything and followed the video, my script just doesn't work.
@madmanga644 жыл бұрын
Awesome thanks!
@snoopyuj3 жыл бұрын
Thank you!!
@TheEsaltasanba Жыл бұрын
u r god man
@inakisoler42213 жыл бұрын
How can I do via script to press a button? E.g: if (Input.GetButtonDown(PS4_X)) --> this button gets pressed;
Activating the Options Button Hi, I'm able to select the options button on the 'Pause Menu' but I can't find a way of activating it other than by pressing the Enter button on a keyboard. My 'On Click()' event on the Options button is set as 'Runtime only' the object is set to the canvas that contains the menu code and I've selected TestMenu.OpenOptions. I assume that its something that I've not setup. I'm using Unity 2019.4.0f1 Thanks & Regards Nick
@nickprice66444 жыл бұрын
Oops Didn't realise that I'd have to click the 'A' on the controller. Nick
@nocultist70503 жыл бұрын
scrollrect, how do I make scrollrect follow selection?
@GuyWithChainsaw3 жыл бұрын
Hey there. I have a quick question. Let's say I made an rpg style inventory. I saw there is a lot of tutorials for them. My question is, Can I control an inventory like that the same way I could control the menu in your tutorial?
@martindubois92792 жыл бұрын
for inventory system i suggest you to use ui toolkit. you can download the inventory system sample :)
@GuyWithChainsaw2 жыл бұрын
@@martindubois9279 Oh. Thanks a lot! I'll look into it
@harimrlocal Жыл бұрын
how to implement this in start menu for options
@FyresGames3 жыл бұрын
Hey Are you the one who made Learn To Create An RPG Game in Unity on Udemy? Your voice seem familliar.