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

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 226

  • @SuperMillwall
    @SuperMillwall 9 місяців тому +12

    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 9 місяців тому +5

    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.

  • @lampeye6177
    @lampeye6177 2 роки тому +10

    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

  • @davidramsey6149
    @davidramsey6149 2 роки тому +20

    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 роки тому +2

      Thank you!!

  • @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!!!

  • @noahcolangelo2718
    @noahcolangelo2718 3 роки тому +2

    The Input system Queen! Thanks for all your videos on it, they've been helping a ton!

    • @samyam
      @samyam  3 роки тому

      Thank you!! :D

  • @ButchLeColosse
    @ButchLeColosse 3 місяці тому

    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.

  • @ShinichiKudoQatnip
    @ShinichiKudoQatnip 2 роки тому +5

    Your videos are lovely but they are extra lovely because of no distracting background music 💕

  • @XxLIVExX24
    @XxLIVExX24 2 роки тому +3

    I knew there was an easy way to do this. Thanks, you helped me understand how to loop the selection and more!

  • @mrpro877
    @mrpro877 Рік тому

    Solved all of my problems in 7 minutes, so glad I've stumbled upon this video

  • @DanDectis
    @DanDectis 2 роки тому

    Yup, every time I go searching for guidance on my next Unity task, I find a samyam video! Thank you!

  • @__ian94__
    @__ian94__ 3 роки тому

    the "deselect on background" is something I never knew about, thank you!

  • @asutoshvariar
    @asutoshvariar 3 роки тому +4

    THANK YOU. I was going crazy trying to fix this. Amazing video!

  • @gabrieldelrosario6692
    @gabrieldelrosario6692 7 місяців тому

    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

  • @Danyko33
    @Danyko33 2 роки тому

    Is not frequently that I find just exactly what I needed, but this video is the rare exception, many, many thanks!

  • @khallington2406
    @khallington2406 3 роки тому +1

    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 :)!!

  • @suicune2001
    @suicune2001 2 роки тому +2

    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.

  • @Challseus
    @Challseus Рік тому

    Every time I’ve looked up a specific video on the input system, it’s always your videos, lol

  • @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 😄

  • @circynsoftware
    @circynsoftware Місяць тому

    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.

  • @MrEljue
    @MrEljue Рік тому

    Vrey clear, and straight to the point, love your tutorials

  • @potionman5521
    @potionman5521 2 роки тому

    I just found your channel I'm so happy with all of the content thus far :)!

  • @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.

  • @LittleTreeX
    @LittleTreeX Рік тому

    In this video, you hit all the right budons.

  • @madbot32
    @madbot32 5 місяців тому

    Thank you!! New go-to place for Unity tutorials :)

  • @bradleysmith1839
    @bradleysmith1839 2 роки тому

    Thanks so much, been using Unity for years and I never knew this. Huge help! :D

  • @Vav97
    @Vav97 Рік тому

    Love your tutorials! Great job!

  • @TheArghnono
    @TheArghnono Рік тому

    Great explanation! This video saved me so much work.

  • @RingtailCafe
    @RingtailCafe 3 роки тому +1

    That was extremely short, to the point, and useful, thank you so much!

    • @samyam
      @samyam  3 роки тому +1

      Yay glad you liked it! Thanks!

  • @ElCosmoXD
    @ElCosmoXD 3 роки тому +2

    I really needed this video!

  • @Zabawne_Gierki
    @Zabawne_Gierki Рік тому

    Thanks, much easier than the old system.

  • @JZGamer
    @JZGamer 3 роки тому

    This channel is amazing. Thank you very much!

    • @samyam
      @samyam  3 роки тому

      Thank you!

  • @catpyjamas
    @catpyjamas Рік тому

    Simple, effective. Greatly appreciated.

  • @MatruKrupabhakti
    @MatruKrupabhakti 3 місяці тому

    Thank you SO Much. This was a straight to point tutorial. Thanks Again.❤

  • @Vihspac
    @Vihspac 3 роки тому

    This tutorial is amazing, thanks for the info!. You deserve more views.

    • @samyam
      @samyam  3 роки тому +1

      Thank you!!

  • @bitcode9612
    @bitcode9612 3 роки тому +2

    Thanks Mam for sharing valuable you are best

  • @vinosilva5458
    @vinosilva5458 3 роки тому

    Straight to the point. Well planned video. Love it.

  • @evgenolab
    @evgenolab Рік тому

    Short and informative, thanks!

  • @eliorubenmc
    @eliorubenmc 2 роки тому

    Easy and clear! just perfect to continue my game!!! Thanks so much!!

  • @turhamonni4270
    @turhamonni4270 2 роки тому

    Really helpful and straightforward! Thank you!

  • @chocobo678
    @chocobo678 3 роки тому

    Pretty straight forward, loved it!

  • @Renegen1
    @Renegen1 3 роки тому

    exactly what I was looking for, ty!

  • @MarioMaier
    @MarioMaier Рік тому

    Very good video, this is exactly what I need!

  • @RickyYhC
    @RickyYhC 2 роки тому

    Extremely cool. Very detailed tutorial. Thanks a lot. :)

  • @rashtopdog8049
    @rashtopdog8049 2 місяці тому

    Thank you so much for making this it helped me a lot

  • @emilyhorton996
    @emilyhorton996 Рік тому

    Amazing video! Thank you so much! Instant subscription!

  • @svenmehlhorn2173
    @svenmehlhorn2173 Рік тому

    love your tutorials, thanks!! :)

  • @DonDisainer
    @DonDisainer 2 роки тому

    your tuts are always the best ones!!! thanks!!

    • @samyam
      @samyam  2 роки тому +1

      Thank you!!

  • @khanlakhno2757
    @khanlakhno2757 2 роки тому +1

    I don't have a UI action map, but it still works. Why is it so?

  • @tofusoup999
    @tofusoup999 2 роки тому

    Thank you so much!This video is the best for Unity UI navigation!

    • @samyam
      @samyam  2 роки тому

      Thank you! 😄

  • @asherharris8577
    @asherharris8577 3 місяці тому

    Made this so easy, thanks!

  • @lorddiego
    @lorddiego 3 роки тому

    Nice. Will try this later on a project I'm working on
    Thanks!

  • @drfelipe4943
    @drfelipe4943 3 роки тому

    Thank you! simple and direct..

  • @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 роки тому +1

      Thank you!

  • @rodrigoreyes2392
    @rodrigoreyes2392 3 роки тому

    thank you, just what I looking for!!! You help me a lot.

  • @Yuhara_rev
    @Yuhara_rev 2 роки тому

    Really well made tutorial, thank you

  • @AmalieKae
    @AmalieKae 3 роки тому +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.

  • @elvismd
    @elvismd 2 роки тому

    That helped me a lot! Thanks!

  • @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"

  • @BennyCanard
    @BennyCanard Місяць тому

    Great explanation, 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?

  • @RockyDogStudiosTV
    @RockyDogStudiosTV 10 місяців тому

    Thanks for the video!

  • @Zaibusa
    @Zaibusa 2 роки тому

    This video is short, precise and very informative! Great video! Are you Brackeys reincarnated?

    • @samyam
      @samyam  2 роки тому

      No, I’m 100% Sam 😎
      Thank you! 😄

  • @marbles8246
    @marbles8246 3 роки тому +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 роки тому +2

      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

  • @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.

  • @richardmolina3d321
    @richardmolina3d321 2 роки тому

    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 2 роки тому

      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
      }
      }

  • @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'.

  • @biswajeetchaudhuri832
    @biswajeetchaudhuri832 2 роки тому

    Subscribed. Thanks for the tutorial.

    • @samyam
      @samyam  2 роки тому +1

      Thank you!

    • @biswajeetchaudhuri832
      @biswajeetchaudhuri832 2 роки тому

      @@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. 👍👏

  • @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.

  • @jasonmantumbi3506
    @jasonmantumbi3506 Рік тому

    Thanks great video 👍

  • @irisdubois-vergiat5469
    @irisdubois-vergiat5469 2 роки тому

    Great video!

  • @ccxv11
    @ccxv11 3 роки тому +1

    ty

  • @bolaniii2324
    @bolaniii2324 2 роки тому

    Great work! I searching for a way to navigate my end game menu with controller/keyboard. But i can't get it to work without using my mouse pointer first. You got any solution or tips for that?

  • @unityalexdev
    @unityalexdev 3 роки тому

    Thank you for this

  • @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!

  • @Veintore
    @Veintore 2 місяці тому

    is there a way to do this without using buttons? I am just using game objects with event triggers

  • @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

  • @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 !

  • @Vastlee
    @Vastlee 3 роки тому +3

    So Many Buddons! 😊

    • @samyam
      @samyam  3 роки тому +1

      Are you the one that keeps commenting buddon on my videos 😂

  • @anonymousme3571
    @anonymousme3571 8 місяців тому

    If my menu has a scroll, how would I make my scroll move down according to what's selected?

  • @Shmiddler
    @Shmiddler 2 роки тому

    Thank you so much!!!

  • @KrestonDev
    @KrestonDev Рік тому

    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?

  • @_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?

  • @Popica9995
    @Popica9995 2 роки тому

    How I can navigate trough buttons with only arrows key? Can you help me with that please?

  • @Naakoo_
    @Naakoo_ 2 роки тому

    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 ? ;(

  • @markpil9933
    @markpil9933 3 роки тому +1

    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 роки тому +1

      I have a video on keyboard and controller navigation which I think matches the first request.
      ua-cam.com/video/Hn804Wgr3KE/v-deo.html
      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 роки тому +1

      Just add the language button but hide on n on explicit just horizontal drop buttons

  • @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.

  • @StarshipJais
    @StarshipJais Рік тому

    +1, thanks for the help.

  • @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 роки тому +1

      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.

  • @danjquiroz
    @danjquiroz 3 роки тому

    THANK YOU!!!

  • @Bfun-rv9ze
    @Bfun-rv9ze 6 місяців тому

    THANK YOU

  • @TeyTey428
    @TeyTey428 10 місяців тому

    I'm having an issue with changing the DefaultInputActions asset because each time I got to save it just says the package cache was invalidated and rebuilt not saving my changes. Nothing online has really good info about it. Does anyone else have this issue or know a fix?

  • @ariatari2137
    @ariatari2137 7 місяців тому

    i have a question and i need a quick response (because im on gamejam now xd)
    when i click the button nothing is selected so when i go to my settings tab (when i press the settings button) nothing more is highlighted.
    how do i connect/make transition from "on click" to highlight another button. You know

  • @gustavorod8715
    @gustavorod8715 Рік тому

    Is there a way to start with no button selected until I press a key or something?

  • @Harry-dh2pm
    @Harry-dh2pm 3 роки тому

    GOAT.

  • @totidokkan
    @totidokkan 2 роки тому +1

    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

  • @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: ua-cam.com/video/Y3WNwl1ObC8/v-deo.html

  • @GokdenizCetin
    @GokdenizCetin 3 роки тому

    After using new input system, (Input.GetKey(KeyCode.Return) || Input.GetKey(KeyCode.JoystickButton10)) code in my one of script started to don't work

    • @samyam
      @samyam  3 роки тому

      Yeah that uses the old input system, if you want to use both systems you can change the active input handling in the player settings but you should completely switch over to the new one if you plan on using it and can do so.
      you can do something like
      Keyboard.current[KeyCode.Return].wasPressedThisFrame

  • @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()

  • @danuvip
    @danuvip 3 роки тому

    thanks i was writing a script with 747 lines for solving this