Controller and Keyboard Menu Navigation w/ Input System - Unity Tutorial

  Рет қаралды 73,348

samyam

samyam

Күн бұрын

Пікірлер: 228
@SuperMillwall
@SuperMillwall 11 ай бұрын
Been watching countless tutorials on how to get this to work and this is BY FAR the easiest and most simplistic way to understand. No nonsense talking, straight to the point. Thank you!
@AporiaLester
@AporiaLester 11 ай бұрын
This is a legendary tutorial. You are fast to the point and you are actually using really good methods. For me that "First Selected" slot in the Event Systems inspector was an insane discovery. Thank you so much.
@davidramsey6149
@davidramsey6149 2 жыл бұрын
This tutorial is immensely good. In fact all of them are - you are straight forward and to the point, but also informative and just all out great! Thank you so much for making all these videos :)
@samyam
@samyam 2 жыл бұрын
Thank you!!
@lampeye6177
@lampeye6177 2 жыл бұрын
Just started using the new input system for the first time. What a massive improvement over the legacy system, which has become tiresome! This is one of the best Unity tutorials i've watched. Clear and to the point. Thanks for your help!
@samyam
@samyam 2 жыл бұрын
Glad to hear!!
@haachamachama7
@haachamachama7 Жыл бұрын
Eh, it has it's ups and downs. Legacy system was WAY easier to figure out, the new system has a lot of weird issues and quirks. The only thing it's good for is multi platform controls. And UI navigation, apparently. lol
@MarcusVeres
@MarcusVeres 29 күн бұрын
You absolute godsend! I found this video after hours of struggling with Jippity and its half-baked code suggestions - to accomplish what I wanted using the UI and zero code. Super clear and to the point tutorial. Thank you!!! 🙌 Subscribed ✅
@samyam
@samyam 29 күн бұрын
Thank you!
@noahcolangelo2718
@noahcolangelo2718 3 жыл бұрын
The Input system Queen! Thanks for all your videos on it, they've been helping a ton!
@samyam
@samyam 3 жыл бұрын
Thank you!! :D
@XxLIVExX24
@XxLIVExX24 2 жыл бұрын
I knew there was an easy way to do this. Thanks, you helped me understand how to loop the selection and more!
@DanDectis
@DanDectis 2 жыл бұрын
Yup, every time I go searching for guidance on my next Unity task, I find a samyam video! Thank you!
@khallington2406
@khallington2406 3 жыл бұрын
Wow I'm in love with your videos and your voice is so calming and perfect it makes me love your channel even more !
@samyam
@samyam 3 жыл бұрын
Thanks :)!!
@ButchLeColosse
@ButchLeColosse 5 ай бұрын
Thanks for the tutorial. It's a quick and easy way to implement menu navigation. One thing I found out while following along is that if you use the Vertical of Horizontal enum values for navigation, there's a checkbox for wrapping around, so no need to do the manual assignation. It's still useful to know how to do custom navigation for more complex menu, or grids.
@gabrieldelrosario6692
@gabrieldelrosario6692 9 ай бұрын
Thank you so much! I had this exact implementation in my mind but i didnt know Unity already does it for you - so without your video I would have had to write everything myself. Very helpful vid
@circynsoftware
@circynsoftware 4 ай бұрын
Thanks for the really useful video - this helped me with an issue I had resetting the button selection/focus on displaying a new pop up window. I ended up creating a C# script similar to the one mentioned in the 'bug' section of your video.
@MatruKrupabhakti
@MatruKrupabhakti 5 ай бұрын
Thank you SO Much. This was a straight to point tutorial. Thanks Again.❤
@durstiespace2270
@durstiespace2270 3 жыл бұрын
*Facepalm* I started hammering away at a script to handle simple button navigation and activation. Turns out there's built in features... THANK YOU!!!
@asutoshvariar
@asutoshvariar 3 жыл бұрын
THANK YOU. I was going crazy trying to fix this. Amazing video!
@ShinichiKudoQatnip
@ShinichiKudoQatnip 2 жыл бұрын
Your videos are lovely but they are extra lovely because of no distracting background music 💕
@potionman5521
@potionman5521 2 жыл бұрын
I just found your channel I'm so happy with all of the content thus far :)!
@Danyko33
@Danyko33 2 жыл бұрын
Is not frequently that I find just exactly what I needed, but this video is the rare exception, many, many thanks!
@mrpro877
@mrpro877 Жыл бұрын
Solved all of my problems in 7 minutes, so glad I've stumbled upon this video
@Antoine-bv8vs
@Antoine-bv8vs Жыл бұрын
Thanks a lot for the tutorials ! I stumbled upon your channel after some time of unsuccesful research and you brought solutions to all the problems I encountered at once 😄
@suicune2001
@suicune2001 3 жыл бұрын
These input tutorials have been great! I was able to fully navigate a quiz game using a controller because of them. So thank you very much! :) If I may make a suggestion for a future video, in my quiz game I was having trouble getting the Play Again? button to work since it was on a different canvas. I used the primarybutton.Select() code in the function I used to show the final score on the canvas and that fixed it. Others might have the same problem so a video might be helpful.
@__ian94__
@__ian94__ 3 жыл бұрын
the "deselect on background" is something I never knew about, thank you!
@bradleysmith1839
@bradleysmith1839 2 жыл бұрын
Thanks so much, been using Unity for years and I never knew this. Huge help! :D
@madbot32
@madbot32 7 ай бұрын
Thank you!! New go-to place for Unity tutorials :)
@MrEljue
@MrEljue Жыл бұрын
Vrey clear, and straight to the point, love your tutorials
@Vihspac
@Vihspac 3 жыл бұрын
This tutorial is amazing, thanks for the info!. You deserve more views.
@samyam
@samyam 3 жыл бұрын
Thank you!!
@RingtailCafe
@RingtailCafe 3 жыл бұрын
That was extremely short, to the point, and useful, thank you so much!
@samyam
@samyam 3 жыл бұрын
Yay glad you liked it! Thanks!
@pixspaces4777
@pixspaces4777 3 жыл бұрын
Really cool and awesome dev tutorials, came across your comment in another channel and saw your stuff! I think we have another Brackeys in the making.. I'm tuned, keep it up :)
@samyam
@samyam 3 жыл бұрын
Thank you!
@AmalieKae
@AmalieKae 3 жыл бұрын
Thank you so much for all your videos on the input system! I've been putting off doing a massive controller-cleanup for my game, and these videos are helping SO much in demystifying the entire thing. I still need to figure out how to execute different code depending on what control scheme is active. (It's oddly difficult to find documentation for, I find.) But you've already made my life so much easier! Thanks! : D Please keep up the brilliant work!
@samyam
@samyam 3 жыл бұрын
Awesome! Glad it helped :) Here's one idea: you can make a state machine and depending on the state, in this case what control scheme is active, then execute some code. Sidenote: your game, Soul Shepherd, looks really cool!!
@diegoperez2490
@diegoperez2490 3 жыл бұрын
I had that problem a few days ago and manage something. I hope this helps you. You can select just one control scheme so the other inputs are disabled using the next code: C# using UnityEngine.InputSystem; ... private InputsActionsG input; ... void AnyFunction_MaybeAbutton(string controlScheme ) { //controlScheme is the exact name of the control scheme you want to select. input.bindingMask = new InputBinding { groups = controlScheme }; } Also, in the same function you can do whatever you want to do depending en the control scheme selected, with some conditionals.
@TheArghnono
@TheArghnono Жыл бұрын
Great explanation! This video saved me so much work.
@Challseus
@Challseus 2 жыл бұрын
Every time I’ve looked up a specific video on the input system, it’s always your videos, lol
@samyam
@samyam 2 жыл бұрын
🫣
@gideonsmith2957
@gideonsmith2957 Жыл бұрын
Thank you so much I spent like 30 minutes trying to figure out why I couldn't swap selections on a dialog menu. Just had to change navigation to explicit lol.
@ElCosmoXD
@ElCosmoXD 3 жыл бұрын
I really needed this video!
@vinosilva5458
@vinosilva5458 3 жыл бұрын
Straight to the point. Well planned video. Love it.
@samyam
@samyam 3 жыл бұрын
Thanks :)
@DonDisainer
@DonDisainer 2 жыл бұрын
your tuts are always the best ones!!! thanks!!
@samyam
@samyam 2 жыл бұрын
Thank you!!
@Vav97
@Vav97 Жыл бұрын
Love your tutorials! Great job!
@samyam
@samyam Жыл бұрын
Thank you!!
@rashtopdog8049
@rashtopdog8049 4 ай бұрын
Thank you so much for making this it helped me a lot
@RickyYhC
@RickyYhC 2 жыл бұрын
Extremely cool. Very detailed tutorial. Thanks a lot. :)
@JZGamer
@JZGamer 3 жыл бұрын
This channel is amazing. Thank you very much!
@samyam
@samyam 3 жыл бұрын
Thank you!
@LittleTreeX
@LittleTreeX Жыл бұрын
In this video, you hit all the right budons.
@catpyjamas
@catpyjamas Жыл бұрын
Simple, effective. Greatly appreciated.
@tofusoup999
@tofusoup999 2 жыл бұрын
Thank you so much!This video is the best for Unity UI navigation!
@samyam
@samyam 2 жыл бұрын
Thank you! 😄
@chocobo678
@chocobo678 3 жыл бұрын
Pretty straight forward, loved it!
@samyam
@samyam 3 жыл бұрын
Thanks!
@Zabawne_Gierki
@Zabawne_Gierki Жыл бұрын
Thanks, much easier than the old system.
@MarioMaier
@MarioMaier 2 жыл бұрын
Very good video, this is exactly what I need!
@svenmehlhorn2173
@svenmehlhorn2173 Жыл бұрын
love your tutorials, thanks!! :)
@Renegen1
@Renegen1 3 жыл бұрын
exactly what I was looking for, ty!
@turhamonni4270
@turhamonni4270 2 жыл бұрын
Really helpful and straightforward! Thank you!
@eliorubenmc
@eliorubenmc 2 жыл бұрын
Easy and clear! just perfect to continue my game!!! Thanks so much!!
@evgenolab
@evgenolab Жыл бұрын
Short and informative, thanks!
@emilyhorton996
@emilyhorton996 Жыл бұрын
Amazing video! Thank you so much! Instant subscription!
@lorddiego
@lorddiego 3 жыл бұрын
Nice. Will try this later on a project I'm working on Thanks!
@asherharris8577
@asherharris8577 6 ай бұрын
Made this so easy, thanks!
@Bytedecoder
@Bytedecoder 3 жыл бұрын
thank you, just what I looking for!!! You help me a lot.
@Zaibusa
@Zaibusa 3 жыл бұрын
This video is short, precise and very informative! Great video! Are you Brackeys reincarnated?
@samyam
@samyam 3 жыл бұрын
No, I’m 100% Sam 😎 Thank you! 😄
@bitcode9612
@bitcode9612 3 жыл бұрын
Thanks Mam for sharing valuable you are best
@elvismd
@elvismd 3 жыл бұрын
That helped me a lot! Thanks!
@biswajeetchaudhuri832
@biswajeetchaudhuri832 3 жыл бұрын
Subscribed. Thanks for the tutorial.
@samyam
@samyam 3 жыл бұрын
Thank you!
@biswajeetchaudhuri832
@biswajeetchaudhuri832 3 жыл бұрын
@@samyam No Problem. I will share your tutorials on Discord Game Dev Channels. You can also make some tutorials on Google Play Game's Leaderboard and Achievements and In-App purchases. 👍👏
@Yuhara_rev
@Yuhara_rev 2 жыл бұрын
Really well made tutorial, thank you
@BennyCanard
@BennyCanard 3 ай бұрын
Great explanation, thanks :))
@drfelipe4943
@drfelipe4943 3 жыл бұрын
Thank you! simple and direct..
@RockyDogStudiosTV
@RockyDogStudiosTV Жыл бұрын
Thanks for the video!
@jasonmantumbi3506
@jasonmantumbi3506 Жыл бұрын
Thanks great video 👍
@Bruce.B
@Bruce.B 3 жыл бұрын
Thank you! Great guide as always. I was really annoyed that I had to use a workaround for that auto select issue. I guess it is kind of a common problem.
@markpil9933
@markpil9933 3 жыл бұрын
Thanks for the great video! Two requests: could you make a similar video for making a left/right "selection" style menu, like for a Mode or Language Selection using the New Input System? Or perhaps a tutorial on attaching SFX to these menus?
@samyam
@samyam 3 жыл бұрын
I have a video on keyboard and controller navigation which I think matches the first request. kzbin.info/www/bejne/fp-bYWeNnNdmgac The second I don’t have a video on yet, but I’ll add it to my list of potential future videos!
@foncode101
@foncode101 2 жыл бұрын
Just add the language button but hide on n on explicit just horizontal drop buttons
@unityalexdev
@unityalexdev 3 жыл бұрын
Thank you for this
@irisdubois-vergiat5469
@irisdubois-vergiat5469 2 жыл бұрын
Great video!
@Shmiddler
@Shmiddler 2 жыл бұрын
Thank you so much!!!
@StarshipJais
@StarshipJais Жыл бұрын
+1, thanks for the help.
@khanlakhno2757
@khanlakhno2757 2 жыл бұрын
I don't have a UI action map, but it still works. Why is it so?
@squiglycontiello2310
@squiglycontiello2310 2 жыл бұрын
Hello. First of all, thanks for showing us how to loop through a menu ! I have a question: How would one change the value of a variable with a keyboard press, using Unity's new Input System ? I'd like it if you could help pleaaaaase !
@infiniteeternalandunchangeable
@infiniteeternalandunchangeable 2 жыл бұрын
Thank you. I was having trouble having the menu be controlled using a controller. Turns out I just needed to select a button to be 'First Selected'.
@Harry-dh2pm
@Harry-dh2pm 3 жыл бұрын
GOAT.
@samyam
@samyam 3 жыл бұрын
🐐
@totidokkan
@totidokkan 2 жыл бұрын
What if i want to have multiple menus, but I can have only one event system. For example- I want to have game end menu and a main menu but I can "first selected" only one object.
@jmoneydotcom
@jmoneydotcom Жыл бұрын
Yeah, I have the same problem / question! I have the Pause Menu, but also the Game Over Menu (that appears over game screen when you die). Did you ever figure out a solution?
@totidokkan
@totidokkan Жыл бұрын
@@jmoneydotcom so in your case, you would want to create a new scene only for your “you’ve died” menu
@totidokkan
@totidokkan Жыл бұрын
I’d advise to check scene management
@richardmolina3d321
@richardmolina3d321 3 жыл бұрын
Aloha, I understand this and works great, HOWEVER what do you do if you go a level deeper in the menu? ie: you select a top level canvas button of lets say "open options" which leads toclosing of this panel buttons and opens another panel of buttons? so far in my experiance I cant get the event system to give selection like the previous menu...... whats the stragety here to do this? Im in the thrawls of your other video of making the gamepad "mouse" cursor, but would be much simpler for my game to just make whatever menu I pop up select the top button etc... I hope this makes sense... loosing hair by the min with this one lol.... thanks for any responses in advance....
@MrGeejayz
@MrGeejayz 3 жыл бұрын
Hi Richard, you could try doing it in code by making reference to your button and then activating its Select() method when you switch to that particular UI screen... [SerializeField] Button startButton = null; //Set your required button in the inspector void Start() { if(startButton != null) { startButton.Select(); //This will set this button as the selected button } }
@ludomancerstudio
@ludomancerstudio Жыл бұрын
Thanks for the tutorial! Is there any workaround if I want to keep the deselect when press on background? How would I be able to go back to the selection?
@Nulify-jc4fs
@Nulify-jc4fs Жыл бұрын
I recommend that instead of using "selected colour" You use "Highlighted colour" which will only change the colour when the mouse is hovered over it, and if you have a controller then it works the same as selected colour. If this doesn't suit your game you can make a custom script.
@MESSENGER1337
@MESSENGER1337 3 жыл бұрын
THANK YOU!!!
@NhuVuNguyen-h2e
@NhuVuNguyen-h2e Жыл бұрын
In 2021 version, you can set the first selected button by dragging your primary button into "EventSystem" game object -> "Event System" component -> "First selected"
@marbles8246
@marbles8246 3 жыл бұрын
Love the video! Does anyone have any tips on if the buttons are deselected once the current panel is disabled and a new panel is enabled? On the main screen panel are a play button, controls button, settings button, and quit button. On the settings and controls panels there are back buttons to go back to main menu (disable their respective panels and re enable the main menu) but once in the settings or control panel, the back button ofc is not default selected like play is in the main menu, and then after manually clicking the back button with mouse, the play button in the main menu is no longer default selected so then the wasd or controller navigation doesn't work anymore. thank you in advance to anyone who can help : -)
@samyam
@samyam 3 жыл бұрын
You can manually select buttons if you have a reference to your button, and do something like button.Select()
@marbles8246
@marbles8246 3 жыл бұрын
@@samyam : o you are amazing!!! thank you so much
@halivudestevez2
@halivudestevez2 2 жыл бұрын
you are like Lady Brackey :D anyway, great tuts!
@samyam
@samyam 2 жыл бұрын
Thanks!
@MrAcpilot
@MrAcpilot Жыл бұрын
When I play this demo, it works perfectly on my keyboard. When I then connect my controller it works perfectly for the controller but my keyboard then has issues where if i cycle through the buttons, sometimes it doesnt actually step to the next button. As soon as I disconnect my controller, it works perfectly again. Any ideas?
@Vastlee
@Vastlee 3 жыл бұрын
So Many Buddons! 😊
@samyam
@samyam 3 жыл бұрын
Are you the one that keeps commenting buddon on my videos 😂
@Bfun-rv9ze
@Bfun-rv9ze 8 ай бұрын
THANK YOU
@Rhydonal
@Rhydonal 3 жыл бұрын
Helpful video! Thank you. Did I miss the bit about how to actually click on a selected button? Figured it out anyway. :) Does anyone know if there's a way to change the "selected" button with the mouse cursor without script. If Button 1 is "selected" and Button 2 is "highlighted" with the cursor, the click will activate the selected button at the same time as highlighted button. Honestly don't see why there's a separate "selected" and "highlighted" case, they should be the same thing really unless you can think of a reason you'd need to use both...
@jaredmartin5670
@jaredmartin5670 2 жыл бұрын
Add an Event trigger ( Pointer Enter) . Drag the button into the object field then click on the drop down box and scroll to Button. Then click on Select(). Do that for each button and that should solve your problem. keep in mind that it has to be Select() and not OnSelect.
@trueblue97
@trueblue97 2 жыл бұрын
This video was super helpful! Most other ones I've found dont seem to use the new input system, or are just a lot harder to understand XD My question though is when I have a button from the initial menu lead to another menu thats in the same scene, how do I make a button from the new set of buttons be highlighted? (P.S. Hope I described this in a way that actually makes sense:P
@samyam
@samyam 2 жыл бұрын
Thanks! You can manually select buttons in code with button.Select() or set the first default selected in the Event System
@trueblue97
@trueblue97 2 жыл бұрын
@@samyam No worries and thanks so much for the response, completely fixed my problem! You're the best samyam! XD
@kadinkaiser2559
@kadinkaiser2559 Жыл бұрын
Would you happen to know how to configure this to navigate with an Oculus Quest controller joystick? I have replicated this video's directions but the first button will not highlight by default or respond to any VR controller joystick input.
@XGS-Studios
@XGS-Studios Ай бұрын
And what would it be like with a scroll view?
@mr.soulless904
@mr.soulless904 3 жыл бұрын
Really cool! , but lets say i have a volume slider how do i select it?
@samyam
@samyam 3 жыл бұрын
You can manually select a UI element docs.unity3d.com/530/Documentation/ScriptReference/UI.Selectable.Select.html, or if you want to hover over it and select it, I have a video that may help you: kzbin.info/www/bejne/j2S6f6qiZrSVeZo
@anonymousme3571
@anonymousme3571 10 ай бұрын
If my menu has a scroll, how would I make my scroll move down according to what's selected?
@ravanin
@ravanin 3 жыл бұрын
You know what would be a perfect tutorial for you to make (at least IMO)? migrating a full project to the input system, I would suggest taking unity's own 2D and 3D game kits and migrating them to use the new input system. Also... These are not the droids you're looking for... err... this is the tutorial you're looking to make.... ;D
@samyam
@samyam 3 жыл бұрын
That’d be an interesting idea, although would take a pretty long time. I’ll keep it in mind, thanks!
@Naakoo_
@Naakoo_ 3 жыл бұрын
Hey ! I have an issue. My button are created after a dialogue (choice system), but, i don't know how to use this system with my buttons. As they are not created at the beginning of the scene, i can chose "first selected" etc... How can i do ? ;(
@ccxv11
@ccxv11 3 жыл бұрын
ty
@safdardeveloper3804
@safdardeveloper3804 2 жыл бұрын
thanks love
@maxexp
@maxexp 3 жыл бұрын
How do you think I could get the event system to find a button as the starting button when the buttons are generated during gameplay? Weird question, I'm sure, but I would very much like to know if you have an answer 😁
@samyam
@samyam 3 жыл бұрын
Yeah of course! Anything is possible. In your function if you have a reference to the button you can do button.Select()
@qpYliqp
@qpYliqp 3 жыл бұрын
Hi ! my button is selected but when I click nothing is happenning, however I put a fonction on the button if it is clicked
@Veintore
@Veintore 4 ай бұрын
is there a way to do this without using buttons? I am just using game objects with event triggers
@KrestonRoblox
@KrestonRoblox Жыл бұрын
Is there any way to make the selected text color black (because the button is white and the text is the child) and change it back to black when deselected while only using one script referenced in only one gameobject instead of every button?
@dalima7342
@dalima7342 2 жыл бұрын
useful🥰
@_ShinobiToB
@_ShinobiToB Жыл бұрын
Hey, do you know how i can use the scroll wheel to cycle through the buttons?... i tried looking through the new input system but every time i tried to save what i thought would make it work.. i got an error that reverted back to default settings.. any clues?
@GNPhoque
@GNPhoque 3 жыл бұрын
Great video, just a question, How do I use the other inputs in the DefaultIputActions? It has default inputs for multiple input types in the player tab so how do I use the inputs from this default file in my code (not for UI)? I could create a new InputAction file, generate the C# class from the inspector and instanciate in my script, but the DefaultInputActions does not have the generate class button (grayed out). Can you help?
@samyam
@samyam 3 жыл бұрын
So you can make a new Input Action Asset with a UI map, then copy all the actions over to your new action map (since you can't change Unity's default one) (you can click the first action, hold down shift, click the last one, Ctrl+C, then Ctrl+V in the new input action asset). Or if you are using the Player Input component it has a button to create a new input action asset which does the same thing. Then you can make another map with your own actions and use that map in your code. I have a video on InputActionMaps and switching between them here if you are interested: kzbin.info/www/bejne/hIulcqWVi5ylZq8
Custom Cursor with Input System - Unity Tutorial
10:40
samyam
Рет қаралды 25 М.
Using Menus with A Controller/Keyboard in Unity
14:34
gamesplusjames
Рет қаралды 79 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Unity's "NEW" Input System with C# Events
16:46
One Wheel Studio
Рет қаралды 94 М.
every step to actually make your dream game (then sell it)
24:27
How to Control Your Menu with Keyboard/Gamepad | Unity Tutorial
9:43
Sasquatch B Studios
Рет қаралды 28 М.
Creating a Custom Tab System in Unity
13:45
Game Dev Guide
Рет қаралды 240 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 216 М.
Why you should use code to animate your UI in Unity.
5:02
Game Dev Guide
Рет қаралды 338 М.
How to Enable UI with the New Input System
6:33
samyam
Рет қаралды 70 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН