I’m trying to make a simple fps game for me and my friends to play and your series on mirror has been super helpful. You are the new brackeys since he’s taking a break
For those of you wondering how to rebind composites: var bindingIndex = forwadAction.action.bindings.IndexOf(x => x.isPartOfComposite && x.name == "Up"); rebindingOperation = forwardAction.action.PerformInteractiveRebinding().WithTargetBinding(bindingIndex). OnMatchWaitForAnother(.1f).OnComplete(operation => RebindComplete()).Start(); To change the other 3 just change "Up" to "Down" "Left" "Right".
Thanks for this. It was a little jarring to see such a well made tutorial just totally skip this "small" detail, even though he has it right there in the input asset, but never talks about how some one might want to rebind that as well.
Thanks for the info, helped a lot. Although I did add an extra line: .WithExpectedControlType("Button") This worked for me after googling, hope this helps for some people.
its super awesome you're addressing this, arguably the most fundamental feature for any game. This tutorial was a big help, however, i'm struggling with cross binding buttons between gamepad and keys from a keyboard.
Integrating the assets from the RebindingUI sample in the InputSystem package hasn't worked entirely, so while this semester-long school project that I'm working on is due in less than 48 hours, better late than never. Lol, but in all seriousness, this was so helpful! Looking forward to future installments on this topic for my personal projects!
Hey just finished your RTS udemy course. great work Just wanted to say thank you. You don't even need the other guys, you're more than capable of doing it by yourself. Looking forward to more from you.
@@DapperDinoCodingTutorials The new Input System has great features, but seems overly complicated for what it is. And lack of clear documentation and lack of hardly any documentation on rebinding is why I haven’t even really touched it in the first place
@@JadonBarnes I saw a video the other day on the Unity channel mentioning a few features (rebinding being one of them) so I had a look into their project and the docs then made this tutorial because I know there are many many people want to know how to implement this in their games!
Suggestions for another Tutorial about it: * Rebinding in a Start Menu without Player * Multiple Rebindings with Loops * Multiple Controler support * Switch Binding Image with Controler (Scriptable Object of Ps4/Keyboard/Switch etc) :D
@@matthieusommervogel1248 If you still can't do this I figured out a way. But I don't use PlayerInput. I use the input action asset (in my case called controls) with subscribing to events (e.g. controls.Gameplay.Dash.performed += OnDash;) I make singleton that holds the asset and get it in every class I need it. Now you just need to modify the script in following way : * replace "playerController.PlayerInput.SwitchCurrentActionMap("Menu");" with "controls.FindAction(actionName).actionMap.Disable();" * replace every "jump.action" with "controls.FindAction(actionName)" - actionName is name of the action in asset * replace "playerController.PlayerInput.SwitchCurrentActionMap("Gameplay");" with "controls.FindAction(actionName).actionMap.Enable();" hope it helps
Daaaaamn, nice! It's such hopeless how Unity is making this so hard and undocumented. They post that Knights demo but with absolutely NO comment anywhere. It's really hard to follow. There's an issue in videogames where key rebinds wouldn't be offered thus making it unplyable for someone who doesn't use a qwerty layout so I had two questions related to that: 1 How to display the actual character on the active keyboard layout instead of the text on a qwerty layout? 2 Is there a possibility to go through the input groups and actions programmatically so a tool could be written to generate a rebind screen (like with tabs for each group - Menu, gameplay, etc) ? Cheers! I'm going to subscribe for now! :)
Thanks for the tutorial, but i have some questions left: How do i rebind 1D Axis inputs? How do i display the binds of the question above? How i keep these binds through scenes? Or better, how do i save the binds to a variable i could use in my singleton? Let me tell you, documentation on this recently 1.0 input system is awful to say the least. The thing itself is very hard to use... Hello again, i'm also wondering: maybe its possible to playerInput/playerController entirely from your script? Or, maybe, you could, if you were to rebind in a scene that is not using any inputs? Reading and watching and testing, dont mind me...
I really enjoyed your tutorial! You did a great job of explaining all the things you were putting in, making this very accessible. There are three things I'm still looking for, though: One, how do you have a "cancel" option in the key binding? So for example, if I selected the wrong input I could press "escape" and it would exit the rebinding function without assigning a new key. Two, how can I revert controls to default? So, rebind input from code instead of specific player input. Three, how do I efficiently handle multiple actions to bind? You said you would do a video on this, but I don't see one yet.
I would be so lost if this project wasn't available on github, tweaking the project made learning what's going on here (vs my previous learned way of just adding InputActions directly to a script) much easier
The documentation for this system is a trainwreck in Unity tradition, thanks for this. I really don't like the concept of having a callback in an IDisposable as you cannot logically guarantee it will get disposed of. Probably try-finally-dispose it just in case.
How would you go about saving this sort of thing with playerprefs? Say I want this to persist between multiple sessions of play, so that a player may return and find their controls exactly the same as they'd been before?
Does this actually update the Controls (Control Import Settings)? Cause if it doesn't you're only going to be able to use it in one scene, your rebinds are not going to carry over.
I know this is an old video but i hope someone can answer, I noticed you're adding classes that you haven't specified and auto-fills the using statements. What addon is that? It would be great to have that.
I want to implement this on top of my game which is using the old Input System and I don't want to change it to new new input system in the near future. Do the two input systems work together/can I use this tutorial anyway?
I have this old video that might help: ruclips.net/video/KNiM53UbGfA/видео.html&ab_channel=DapperDino and there are plenty other videos on getting set up with the Input System on RUclips :)
how would you do this like in source games, where for example you could do bind mwheelup +jump how do you bind a key to an action instead of an action to a key, and also how would you have multiple
hey there, I absoluetly love your videos they help so much. anyway I was wondering I'm trying to make a game like pulsar lost colony but im having trouble trying to get the rigid body character to stay on the floor like gravity generator? also ive been struggling to switch from player controls to ship controls, like stopping the character moving switching the cameras ect? :/
Thanks Dino, great tutorial, saved us a lot of time! With me, works fine with a keyboard, I also tested with a joystick and didn't work, looks like a "array index check". Any idea why not?
Hi! Thanks for the video! Just for curiosity, is it possible to remap or build custom axis like horizontal/vertical default input manager has? Stay safe&cool and keep it up!
You're welcome! I've been looking into this because I know it is possible for sure, but I do think there is a bit of code that will be slightly different to what I did in this video. I'll be sure to include it in an upcoming Input System video once I've figured it out myself. Good luck in the meantime! Let me know if you figure it out first :D
@@DapperDinoCodingTutorials I found this: wiki.unity3d.com/index.php?title=Unity_Custom_Input_Manager&_ga=2.265472719.1509041107.1607721878-17885974.1474273148 hope it helps!
This sounds amezing and samthin i definitely needs i have few questions i few problems Problems 1. I did know haw to use axis in the new input system 2. In my project omost all the code made with the old input system i know haw too change i the normal buttons few off this with but i don't know for button like axis and i don't find eny tourial from that to replace the code from old input system to new 3. The new input system supports only the device i have been added and the consoles contrllers this i problem because off that if saman has i different therd party controllers from what im used the don't ablel to play that mens if want to make customize buttons from therd party controllers the need to use the old input system Questions 1. Haw to create axis 2. There is eny way to support all devices and not need to add eny therd party controllers separately
I have been through so many articles, scripts, stackoverflows, etc. I have yet to find a single solution to how your rebind a key with the new input system and a control scheme... Over 8 hours of pure google searching, this video didnt help either unfortunately, please if you know how make a video on it. Even the sample didnt work...
oh god, thank you for this. I've been searching for a tutorial for this and they just don't exist anywhere else! You're a lifesaver!
I’m trying to make a simple fps game for me and my friends to play and your series on mirror has been super helpful. You are the new brackeys since he’s taking a break
Thanks for the kind words!
I agree !
For those of you wondering how to rebind composites:
var bindingIndex = forwadAction.action.bindings.IndexOf(x => x.isPartOfComposite && x.name == "Up");
rebindingOperation = forwardAction.action.PerformInteractiveRebinding().WithTargetBinding(bindingIndex).
OnMatchWaitForAnother(.1f).OnComplete(operation => RebindComplete()).Start();
To change the other 3 just change "Up" to "Down" "Left" "Right".
Thanks for this. It was a little jarring to see such a well made tutorial just totally skip this "small" detail, even though he has it right there in the input asset, but never talks about how some one might want to rebind that as well.
Thanks for the info, helped a lot.
Although I did add an extra line:
.WithExpectedControlType("Button")
This worked for me after googling, hope this helps for some people.
I was like "let's see if this guy has a tutorial for this, just in case..." and there you have it! Thank you!
its super awesome you're addressing this, arguably the most fundamental feature for any game. This tutorial was a big help, however, i'm struggling with cross binding buttons between gamepad and keys from a keyboard.
exactly what i was looking for
Great to hear!
Thanks for this! I was just in the middle of researching how to do this exact thing and here you go!
How convenient! Hope you find it useful :)
Integrating the assets from the RebindingUI sample in the InputSystem package hasn't worked entirely, so while this semester-long school project that I'm working on is due in less than 48 hours, better late than never. Lol, but in all seriousness, this was so helpful! Looking forward to future installments on this topic for my personal projects!
That's got to be the best 15minutes I'll ever spend. (Unity-wise)
Thanks!
Hey just finished your RTS udemy course. great work Just wanted to say thank you.
You don't even need the other guys, you're more than capable of doing it by yourself. Looking forward to more from you.
The mad lad finally did it! THANK YOU!
Been wanting this for a while? :D
@@DapperDinoCodingTutorials The new Input System has great features, but seems overly complicated for what it is. And lack of clear documentation and lack of hardly any documentation on rebinding is why I haven’t even really touched it in the first place
@@JadonBarnes I saw a video the other day on the Unity channel mentioning a few features (rebinding being one of them) so I had a look into their project and the docs then made this tutorial because I know there are many many people want to know how to implement this in their games!
Suggestions for another Tutorial about it:
* Rebinding in a Start Menu without Player
* Multiple Rebindings with Loops
* Multiple Controler support
* Switch Binding Image with Controler (Scriptable Object of Ps4/Keyboard/Switch etc)
:D
after many tries, I still can't create a rebind menu in the main menu without the playercontroller :(
@@matthieusommervogel1248 bcs it depends on the references. the playercontroller component is like public YOURINPUTSCRIPTNAMR yourinputscriptname;
@@davidk1526 Ok so i think we can make this rebind panel in main menu by using the generated script. I just got an idea
@@matthieusommervogel1248 ofc you can all do with c# script the components based on coding too ^^
@@matthieusommervogel1248 If you still can't do this I figured out a way. But I don't use PlayerInput. I use the input action asset (in my case called controls) with subscribing to events (e.g. controls.Gameplay.Dash.performed += OnDash;) I make singleton that holds the asset and get it in every class I need it. Now you just need to modify the script in following way :
* replace "playerController.PlayerInput.SwitchCurrentActionMap("Menu");" with "controls.FindAction(actionName).actionMap.Disable();"
* replace every "jump.action" with "controls.FindAction(actionName)" - actionName is name of the action in asset
* replace "playerController.PlayerInput.SwitchCurrentActionMap("Gameplay");" with "controls.FindAction(actionName).actionMap.Enable();"
hope it helps
Daaaaamn, nice! It's such hopeless how Unity is making this so hard and undocumented. They post that Knights demo but with absolutely NO comment anywhere. It's really hard to follow.
There's an issue in videogames where key rebinds wouldn't be offered thus making it unplyable for someone who doesn't use a qwerty layout so I had two questions related to that:
1 How to display the actual character on the active keyboard layout instead of the text on a qwerty layout?
2 Is there a possibility to go through the input groups and actions programmatically so a tool could be written to generate a rebind screen (like with tabs for each group - Menu, gameplay, etc) ?
Cheers! I'm going to subscribe for now! :)
Hey Dino. Such a great content! I would love to see more advanced input system operations.
just what i needed my guy came through with the clutch thanks.
EXACT THING I NEEDED
Great to hear!
Just what I was looking for Thank you mate!
Rebinding code is at: 6:43, everything before this is about setting up the demo project.
Thanks for the tutorial, but i have some questions left:
How do i rebind 1D Axis inputs?
How do i display the binds of the question above?
How i keep these binds through scenes? Or better, how do i save the binds to a variable i could use in my singleton?
Let me tell you, documentation on this recently 1.0 input system is awful to say the least. The thing itself is very hard to use...
Hello again, i'm also wondering: maybe its possible to playerInput/playerController entirely from your script? Or, maybe, you could, if you were to rebind in a scene that is not using any inputs? Reading and watching and testing, dont mind me...
holy shit I've been blessed
Happy to hear :D
Nice tutorial, really good explained. just keep it up. your the next brackeys :D
Glad you enjoyed it! And thanks for the kind words :)
I really enjoyed your tutorial! You did a great job of explaining all the things you were putting in, making this very accessible.
There are three things I'm still looking for, though:
One, how do you have a "cancel" option in the key binding? So for example, if I selected the wrong input I could press "escape" and it would exit the rebinding function without assigning a new key.
Two, how can I revert controls to default? So, rebind input from code instead of specific player input.
Three, how do I efficiently handle multiple actions to bind? You said you would do a video on this, but I don't see one yet.
I would be so lost if this project wasn't available on github, tweaking the project made learning what's going on here (vs my previous learned way of just adding InputActions directly to a script) much easier
The documentation for this system is a trainwreck in Unity tradition, thanks for this. I really don't like the concept of having a callback in an IDisposable as you cannot logically guarantee it will get disposed of. Probably try-finally-dispose it just in case.
Does this rebinding get automatically persisted by Unity in built games?
does this work with game pads
Hey ! Awesome tutorial, very helpful.
Idk know why but it seams not working in 2022
Video is missing what calls StartRebinding() and RebindComplete()
How would you go about saving this sort of thing with playerprefs? Say I want this to persist between multiple sessions of play, so that a player may return and find their controls exactly the same as they'd been before?
You're a legend sir! :)
Can you make a tutorial on rebinding with the old input system?
Great video mate
that was very helpful
Great to hear!
Does this actually update the Controls (Control Import Settings)? Cause if it doesn't you're only going to be able to use it in one scene, your rebinds are not going to carry over.
Awesome. Thanks!
No problem!
Is it possible to save this change?
I know this is an old video but i hope someone can answer, I noticed you're adding classes that you haven't specified and auto-fills the using statements. What addon is that? It would be great to have that.
perfect timing!
I want to implement this on top of my game which is using the old Input System and I don't want to change it to new new input system in the near future. Do the two input systems work together/can I use this tutorial anyway?
I was just looking for something like this last night! Do you think this solution could be used together with a joystick too?
I don't see why not! Though it's been a while since I've had a joystick to be able to test it myself. Give it a go and let me know if it works!
How could I make this save the keybinds in between Sessions?
Thank u, how to add input system, never done this before
I have this old video that might help: ruclips.net/video/KNiM53UbGfA/видео.html&ab_channel=DapperDino and there are plenty other videos on getting set up with the Input System on RUclips :)
@@DapperDinoCodingTutorials thank you man ❤️
how would you do this like in source games, where for example you could do
bind mwheelup +jump
how do you bind a key to an action instead of an action to a key, and also how would you have multiple
Is the way to save this binding by going through playerprefs or can u change the asset itself in some way?
hey there, I absoluetly love your videos they help so much. anyway I was wondering I'm trying to make a game like pulsar lost colony but im having trouble trying to get the rigid body character to stay on the floor like gravity generator? also ive been struggling to switch from player controls to ship controls, like stopping the character moving switching the cameras ect? :/
Thanks Dino, great tutorial, saved us a lot of time! With me, works fine with a keyboard, I also tested with a joystick and didn't work, looks like a "array index check". Any idea why not?
Why do you set your variables as null when declaring them at the beginning of the script?
man you are awesome
Thank you!
You can pass the RebindingOperation through the OnComplete callback, don't use a lambda, only pass RebindComplete
Hi! Thanks for the video!
Just for curiosity, is it possible to remap or build custom axis like horizontal/vertical default input manager has?
Stay safe&cool and keep it up!
You're welcome! I've been looking into this because I know it is possible for sure, but I do think there is a bit of code that will be slightly different to what I did in this video. I'll be sure to include it in an upcoming Input System video once I've figured it out myself. Good luck in the meantime! Let me know if you figure it out first :D
@@DapperDinoCodingTutorials I found this:
wiki.unity3d.com/index.php?title=Unity_Custom_Input_Manager&_ga=2.265472719.1509041107.1607721878-17885974.1474273148
hope it helps!
Thanks a lot!!
What about composite rebinding?
Unity's new Input system is such a headache, I don't understand why they didn't just expand the legacy one which works so nicely
help! It works for me but for example my player jump with "space" I change the key to "j" it works, but the "space" key still works. Helpme pls!
just how to save the new key to the system so that wan exit the game still there wan i get back to it 🤔🤔
This sounds amezing and samthin i definitely needs i have few questions i few problems
Problems
1. I did know haw to use axis in the new input system
2. In my project omost all the code made with the old input system i know haw too change i the normal buttons few off this with but i don't know for button like axis and i don't find eny tourial from that to replace the code from old input system to new
3. The new input system supports only the device i have been added and the consoles contrllers this i problem because off that if saman has i different therd party controllers from what im used the don't ablel to play that mens if want to make customize buttons from therd party controllers the need to use the old input system
Questions
1. Haw to create axis
2. There is eny way to support all devices and not need to add eny therd party controllers separately
Missing on persistence on rebinded controls.
96th like, doesn't matter if you look upside down😂😂
I have been through so many articles, scripts, stackoverflows, etc. I have yet to find a single solution to how your rebind a key with the new input system and a control scheme...
Over 8 hours of pure google searching, this video didnt help either unfortunately, please if you know how make a video on it.
Even the sample didnt work...
I mean, problems arise when you have composite bindings and controller + keyboard
Rebinding a single keybinding/action really isn't hard
How to save changes?
There is a method added to load/save in the 1.1 Input System preview
A more efficient way for press a button text would be to set the button’s text to that and disable interactable and then capture input
Sarò sempre dalla parte di maldini
1:59
This has less than 10K views. Really makes yuo realize why Unity games have such bad fame...
couldnt find the haitch key.