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!
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.
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!
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
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 :)
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.
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
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.
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 😄
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.
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.
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 :)
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!
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!!
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.
In 2021 version, you can set the first selected button by dragging your primary button into "EventSystem" game object -> "Event System" component -> "First selected"
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?
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 : -)
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.
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....
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 } }
@@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. 👍👏
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?
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.
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?
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
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 !
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?
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?
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 ? ;(
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?
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!
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.
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...
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.
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?
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
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.
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?
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
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
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 😁
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!
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.
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!
Glad to hear!!
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
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 :)
Thank you!!
*Facepalm* I started hammering away at a script to handle simple button navigation and activation. Turns out there's built in features... THANK YOU!!!
The Input system Queen! Thanks for all your videos on it, they've been helping a ton!
Thank you!! :D
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.
Your videos are lovely but they are extra lovely because of no distracting background music 💕
I knew there was an easy way to do this. Thanks, you helped me understand how to loop the selection and more!
Solved all of my problems in 7 minutes, so glad I've stumbled upon this video
Yup, every time I go searching for guidance on my next Unity task, I find a samyam video! Thank you!
the "deselect on background" is something I never knew about, thank you!
THANK YOU. I was going crazy trying to fix this. Amazing video!
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
Is not frequently that I find just exactly what I needed, but this video is the rare exception, many, many thanks!
Wow I'm in love with your videos and your voice is so calming and perfect it makes me love your channel even more !
Thanks :)!!
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.
Every time I’ve looked up a specific video on the input system, it’s always your videos, lol
🫣
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 😄
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.
Vrey clear, and straight to the point, love your tutorials
I just found your channel I'm so happy with all of the content thus far :)!
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.
In this video, you hit all the right budons.
Thank you!! New go-to place for Unity tutorials :)
Thanks so much, been using Unity for years and I never knew this. Huge help! :D
Love your tutorials! Great job!
Thank you!!
Great explanation! This video saved me so much work.
That was extremely short, to the point, and useful, thank you so much!
Yay glad you liked it! Thanks!
I really needed this video!
Thanks, much easier than the old system.
This channel is amazing. Thank you very much!
Thank you!
Simple, effective. Greatly appreciated.
Thank you SO Much. This was a straight to point tutorial. Thanks Again.❤
This tutorial is amazing, thanks for the info!. You deserve more views.
Thank you!!
Thanks Mam for sharing valuable you are best
Straight to the point. Well planned video. Love it.
Thanks :)
Short and informative, thanks!
Easy and clear! just perfect to continue my game!!! Thanks so much!!
Really helpful and straightforward! Thank you!
Pretty straight forward, loved it!
Thanks!
exactly what I was looking for, ty!
Very good video, this is exactly what I need!
Extremely cool. Very detailed tutorial. Thanks a lot. :)
Thank you so much for making this it helped me a lot
Amazing video! Thank you so much! Instant subscription!
love your tutorials, thanks!! :)
your tuts are always the best ones!!! thanks!!
Thank you!!
I don't have a UI action map, but it still works. Why is it so?
Thank you so much!This video is the best for Unity UI navigation!
Thank you! 😄
Made this so easy, thanks!
Nice. Will try this later on a project I'm working on
Thanks!
Thank you! simple and direct..
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 :)
Thank you!
thank you, just what I looking for!!! You help me a lot.
Really well made tutorial, thank you
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!
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!!
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.
That helped me a lot! Thanks!
In 2021 version, you can set the first selected button by dragging your primary button into "EventSystem" game object -> "Event System" component -> "First selected"
Great explanation, thanks :))
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?
Thanks for the video!
This video is short, precise and very informative! Great video! Are you Brackeys reincarnated?
No, I’m 100% Sam 😎
Thank you! 😄
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 : -)
You can manually select buttons if you have a reference to your button, and do something like button.Select()
@@samyam : o you are amazing!!! thank you so much
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.
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....
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
}
}
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'.
Subscribed. Thanks for the tutorial.
Thank you!
@@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. 👍👏
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?
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.
Thanks great video 👍
Great video!
ty
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?
Thank you for this
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
That’d be an interesting idea, although would take a pretty long time. I’ll keep it in mind, thanks!
is there a way to do this without using buttons? I am just using game objects with event triggers
Hi ! my button is selected but when I click nothing is happenning, however I put a fonction on the button if it is clicked
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 !
So Many Buddons! 😊
Are you the one that keeps commenting buddon on my videos 😂
If my menu has a scroll, how would I make my scroll move down according to what's selected?
Thank you so much!!!
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?
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?
How I can navigate trough buttons with only arrows key? Can you help me with that please?
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 ? ;(
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?
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!
Just add the language button but hide on n on explicit just horizontal drop buttons
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.
+1, thanks for the help.
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...
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.
THANK YOU!!!
THANK YOU
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?
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
Is there a way to start with no button selected until I press a key or something?
GOAT.
🐐
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.
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?
@@jmoneydotcom so in your case, you would want to create a new scene only for your “you’ve died” menu
I’d advise to check scene management
Really cool! , but lets say i have a volume slider how do i select it?
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
After using new input system, (Input.GetKey(KeyCode.Return) || Input.GetKey(KeyCode.JoystickButton10)) code in my one of script started to don't work
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
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 😁
Yeah of course! Anything is possible. In your function if you have a reference to the button you can do button.Select()
thanks i was writing a script with 747 lines for solving this