If you're following this tutorial and can't find yourself a 2d composite please note that unity input 1.3.0 or above, has wrap up the composite creation on Movement(green tab) select action type from "button" to> "Value" and underneath controltype to "Vector2" now when you right click on green tab it will show up/down/left /right composite which is the same in this video and you will be needed unity input 1.1.0 or above for key rebinding later on
Glad it helped! Do check out the whole playlist with a bunch of applications of the new input system ;) ruclips.net/p/PL7S-IAgf3dlUPT3iheJaUWu-Johr8bgCk
Just a part way in and I can see a few things, this video is updated with new information unlike others that are heavily outdated with experimental information, the information is concise and honest / straight to the point that this new system is more complex, and its heavily detailed with suggestions of where else to look for further information with the video broken into sections. Subbed! Keep up the videos, these are really really well made.
You can also use a Vector2 Value Action type with Composit2D binding for WASD(Tip: create a 2nd composit2D and drag bindings up to 1st one and bind arrow keys then delete empty one), and a left stick(Gamepad) binding. This is how the Unity team set up their InputActions for their free: 'Starter Assets Third Person Character Controllers' asset.
Thank you for putting out a wonderful tutorial that explains very precisely, without confusion the new and rather complicated Input System! Not only that, you also explain why the new Input System is superior in some cases! Thank you very much for freeing us from the pain of confusion of the new input system!
Adding a gamepad on the old system is super simple. Took 5 minutes and no additional code after watching a tutorial on RUclips. But this is still a good tutorial.
SUCH a good tutorial! Really clean and easy to understand, thank you! I'm super glad they built this new system as it keeps the code much cleaner and allows for a lot of flexibility in your game's input.
I have been learning this system for 2 days. I've seen some people using the Player Input component. Which made it even more complex & vague. Your explanation and way of doing it, is the best I've encountered. Thank you for your time & effort. :)
Just watched your Delegates, Events, Actions and Funcs video and this back to back and you sir, have a new subscriber. I'm trying to switch over from using the OVR input system for my first VR game and almost had a heart attack when I realised what I'd have to do to use this, but I can see how this method would clean up code across the whole project. Thank you!
Best explanation I've encountered so far. Although it wasn't what I was looking for, it does shed some light on the input system itself. Now I just have to figure out how to do this with complex UI scenes like main menu n all that.
UI is another thing for sure! Getting basic button clicks and such to work is pretty easy, but I'd definitely like to get deeper into some of the functionality. Glad the video was useful!
Thanks for the walkthrough. I was using the C# events as regular events and was getting severe performance issues. I didn't know I had to use farmerInputActions.Disable() on OnDisable() for the new InputSystem. You don't have to do that for each event [e.g. farmerInputActions.Player.Jump.Disable()], just for the input mapping file itself [farmerInputActions.Disable()]. Great video!
I'm very grateful for this video! at the start of the month I decided to get back into making my own game again, but I put a lot of time into learning the old system and gotten use to it really well. But coming back after a year, and seeing how many people are pushing for the new system, I wanted to try and learn it and use it. How ever, it was kind of over whelming, and a lot of tutorials I tried to look up didn't really explain what a lot of the systems did (example : the action types), and I just got frustrated and stopped trying to make my game. Today I said "To heck with it" and i was going to use the old system. Before I did I decided to look up tutorials for the new system one last time just in case . Your video came up and I gotta say THANK YOU! Your tutorial was much more straight forward, and easy to understand , even more so when you explained each part did . Again, thank you so much! Edit : I would really like to see a tutorial on "Tank Controls" with the new input system ! I understand WASD movement, but I always liked the resident evil style control type, and I always wondered how I could use that as well. Or to be more precise , using A and W to rotate the character , and using W and S to move forward and backwards. I could never find a good tutorial on how to make my own, both in 2d and 3d games. Could you cover that controller type in the future some time please? I would love that!
Thank you for this video! I had been wracking my brain trying to understand how to make this work and other videos I found were using the older version which was more confusing than anything! Thank you again!
Thorough walkthrough of the new input system. I stumbled upon this after fighting for 6 hours through the unity documentation which has dozens of disjointed code snippets, screenshots, and code explanations that culminates into a failure to convey any cohesive usage of their own system. HUGE Thank you for the time and effort you put into this!
It's actually surprising how bad the documentation for the new input system is. Unitys standard documentation is usually so clean, precise and has clear examples so it's weird to see it so messy
Upon watching your Key Rebinding I realised from this video I didn't generate my C# script, I was going crazy! I have to say though your videos are super helpful and I am 100% going to be watching more. Thank you :)
Thank you so much! I used this system in 3 different ways and always felt like it was not the right structure... I finally connected the dots with this video.
There's no "Add 2D Vector composite" option now. The only options are "positive/negative binding" and "binding with one modifier" and "binding with two modifiers". Currently on Input System 1.2.0 How do I proceed? UPDATE: It seems having that option was a bug as it shouldn't be available for button actiontypes. UPDATE 2: If you select "Value" Action Type and "2D Vector" as control type you have the "left/right/up/down Composite"
Maybe I'm a little late, or it was said allready - but - I think the Gamepad Left Stick/Left - problem mentioned around 9:20, you can solve that issue by choosin Movement - Action Type "Value" instead of "Button". Then it should give you the oportunity to choose assign Gamepad Left Stick natively. Thank you for that nice and quick tutorial. Sorry for the crappy english xP kind regards and happy learning everyone.
Great Video! Just wanted to say thank you, as this got me a format that actually posted through as I wanted. Been banging my head on getting it working for weeks. Great teaching style too; you've got a patron. Keep 'em coming!
So glad the video helped. And a sincere thank you for the support on Patreon! If you've got questions, or something I can help with don't hesitate to reach our and or join the OWS discord.
Great video! Been toying around a bit with trying to understand how it functions compared to Rewired. I would love to see more on the new Input System.
Loved the video. Been struggling for some time with the new Input System. I would love more videos seeing how it works with Touchscreen and UI... My 2 cents.
The dropdown menus on the control schemes are slightly different now. I had to use Action Type : Value, Control Type: Any and then "Add Up/Down/Right/Left Composite to get the WASD key bindings set up. This tutorial is only a few months old and it's already slightly off. :D
Welp, I've already been working to cleanup my visual scripts, might as well put in the bit of extra effort and swap to the new input system. Then I can avoid worrying about touch vs mouse input as much.
I would like to know how to let the player customise the controls. That they can change the shoot button from say X to Y or from Space bar to the Enter key. Otherwise, an excellent tutorial and presentation style. Clean and concise with solid modelling.
please make more videos about this new system. very interesting! a day ago tryed to make a in-game zoom(by changing fov when right mouse button is held and unzoom when released) but failed and in few lines made it on ols systen)
I've got a playlist with more videos. ;) I'm also working on a split screen video at the moment. Playlist: ruclips.net/p/PL7S-IAgf3dlUPT3iheJaUWu-Johr8bgCk
I'd find it interesting to see how the new Unity Input system might be used for like a fighting game style of input. Where it recognizes that doing a quarter-circle motion plus an attack button performs a 'special move'
Short answer: it's really hard. I've got something working and it's flexible enough that I can add new special moves easily (using scriptable objects) , but the reading/parsing of inputs is tricky. How do you handle charge moves? How do you handle moves that require multiple buttons simultaneously (so Forwards + Punch for example)? Then you need to think about the direction the player is facing. O_O None of these issues by themselves is, well, an issue; but keeping all the balls in the air at the same time is the tricky part. How you want your fighting game to play may make some situations a non-issue (for example, if your game won't have Lightning Kick/Hundred Hand Slap style moves, you won't need to check for rapid tap inputs) It's all possible and I'm very confident better devs than me would have better solutions. Oddly enough the actual "do these inputs match this special move?" is relatively straight forward, the hard part is not having the incoming inputs turn into an incoherent mess
@@JohnnyThousand605 yeah, I know it isn't out of the box easy. Best I've done ATM is get all my inputs to report into a byte each frame. I have four directions and three buttons combining to form the single byte. So if you were to see the byte as 8 bits, pressing left and punch would be 00100100 and down plus punch plus kick would be 01100010. Recording each frame within a limited array, combined with pop and pushing can see a history of inputs per frame. Then the moves you can issue a requirement of a set order with a number of frames accepted between specific input changes I expect. So something like quarter circle forward might be looking through recent inputs for 00000010 and then looking for 00001010 within 20 frames, if checks then look for 00001000 within another 20 frames, and say the punch can be registered up to a second later so 00100000 within 60 frames. Can be further divided by just checking first half byte for directionals and last half byte for buttons. In case where the buttons are allowed to be pressed during inputs? Dunno. But at least I think it might be workable from there.
@@PontonFSD Nice. That looks like a solid way of doing it. I'm guessing because you're using bytes it's very performant? The way I've done it is to create an enum called InputButton that can be Neutral, UpForward, Forward, DownForward etc, then made a ComboInput class that holds an InputButton variable (set in the inspector) and a function in the ComboInput class that takes an InputButton argument and returns true/false if it matches its own InputButton. Each move ScriptableObject then has an array of these ComboInputs and I can set the sequence of InputButton enums in the Inspector. There's an InputChecker class that holds a list of all the special move ScriptableObjects, sends out the current input to be checked to the special moves and receives a response from each. Any that return false (ie, the input is not that special move's next valid input) are relegated until the next frame, but if a move reaches the last of its valid inputs it triggers the actual special move. This is a proof of concept/demo bitglassgames.itch.io/block-fighter
This was an extremely well-explained tutorial. I'm probably going to stick with the traditional input system since I'm only using a few very simple button presses, but this is worth looking into in the future.
Instead of subscribing directly to each action please use SetCallbacks which are ready for you inside your generated c# class. Great tutorial but I would like to see more in-depth tricks because like you said more of the videos do that.
@@OneWheelStudio I'm not sure but one day I checked Unity open project and they use it in some nice way maybe you can find something interesting there for new video because they constantly creating this project. Also I try to do some Vector button on int but I think there is no option for that and I must cast from float or made separate two actions or I just cant handle this.
This helped me a bit on the way. I would have found it a lot more useful if you had split the video into two parts, one for a general explanation of the input system and another where you go into more detail about subscribing to c# events. For instance, as of this point I'm still not sure how to subscribe to an action without directly subscribing to the phase through c# events.
Can you make a video how to trigger ui buttons in unity using the new input system with keyboard and gamepad. I am asking because i got really trouble using the gamepad there. The ui button looses the focus and the on click default event of the button is not raised using the gamepad. Using the keyboard is not a problem. I turned off the mouse control at all. That is because my game is foreseen for mouse control. But on top when mixing mouse and gamepad then will the the gamepad trigger the ui button only as expected when the mouse pointer is on the buttons position. Otherwise the button just loose focus because the mouse button is outside a user control area. But when turning off the mouse and also ensure in code that any ui control is focussed always, it will losse still the focus by triggering the gamepad button to raise the on click event of the ui button. Would be perfect to see such video how to control ui buttons and ui toggles checkboxes.
My experience with the new input system so far is that it caused the fans to start whirring on my 3900X while producing choppy, erratic movement that just felt lag-tastic.
That’s definitely strange and seems like something is wrong. If anything performance should be a bit better as you don’t have to poll inputs every frame. If you’ve got code that you know is causing the issues feel free to drop by the OWS discord and share it. I’d be interested to see what’s going on.
Hey there, is there a simple way to modify the action processors via script at runtime? For example a ScaleVector2 for a camera input. I can't find a solution that is working for me. Also, i am using the Cinemachine Input Provider with a CinemachineFreeLook camera if you know about any restrictions in this context. Great video as always and thanks!
Update: On verified verion 1.0.2, touch's release does not recognize inside game view. On preview 5 version 1.1.0, touches does not even get recognized T~T.
Hey, I'm new here and I have a question: I found how to create a input action with a modifier(Shift) which is Shift+Right Mouse Button, but now my other action with only Right Mouse Button(no mods) is also triggering at the same time. How to I prevent my RMB action to trigger when I use my Shift+RMB? And thanks for all the content about the New Input System, its been really helpful.
Hmm. This isn't something I've dealt with yet. So I did some research. From what I can tell is Unity hasn't resovled this problem!!! There are work arounds. Here's one that seems to make sense and I've seen others reference. If you find a good solution I'd love to know what it is. Link: stackoverflow.com/questions/65546739/new-unity-input-system-is-there-a-way-to-not-execute-an-action-if-a-modifier-i
On the subject of the video itself, it would be nice to see a demonstration of how to work with swapping between different action maps, when using the C# events approach instead of the built-in controller. I had a good bit of difficulty with that in one of my projects.
Blog post on the New Input System: onewheelstudio.com/blog/2021/5/8/unitys-new-input-system Version 1.0.2 of the input system was used along with Unity 2020.3 ***See the conversation with Dave below, for a possible issue re unsubscribing.
Great explanation mate! Can you please create a video explaining how to use multiple interactions on the same input binding. Example: Jump on "Tap" and SuperJump on "SlowTap/Hold" both on the "space" key. Especially regarding, on how to update a value of a variable. Like, it should only be able to jump twice. I'm seeing an issue (bug or bad implementation?) where the value "jumpsRemaining" variable is the old one, instead of the current one, hence I end up jumping maxJumps + 1 instead of just maxJumps. I wonder if this is something to do with the event system itself using old values? But I am not sure on the keywords to research this problem further.
These are great questions! The nitty gritty of the system is not simple that's for sure. I think a good starting point would be to look at the CallbackContext documentation. This is the type of the parameter that is sent in the event. I basically ignored it in the video, but you can get all kinds of info about the event from it. Link: docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.InputAction.CallbackContext.html You may also read up on the interactions to create tap and or press and hold functionality. Link: docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Interactions.html?q=interactions Based on what you are describing you may also need to subscribe to multiple events - started, canceled and performed. When these events are invoked they can start or end timers that are then monitored and functions called based on the timer. For example if the time between started and canceled is short you do the short jump or if it's long you do the power jump. Hopefully one of those ideas gives is helpful and moves you in a good direction.
@@OneWheelStudio Thanks. I managed to stumble across the same docs you linked earlier today. The Update/FixedUpdate loop was running immediately after firing the event which would overwrite my variable. Fixed it by subscribing to multiple interactions like you pointed out and switched to using TriggerEnter2D which seems to fire something like an event(?), And is not dependant on being polled. I guess that's what you get for mixing event based systems will polling architectures...
Please do more videos about Unity Input System, maybe one about using it with touch and gestures. ;) Question If you're add DoJump method to the Jump event in the OnEnable handler, then you shouldn't remove it in OnDisable handler?
In general, whenever I subscribe to an event in OnEnable I ALWAYS unsubscribe in the OnDisable, but in this case, when you call "Disable" on the input action the events will not be called and since the Input Action Asset is a local instance there's no risk of invoking the event when the object is disabled or destroyed. So I think you very much could unsubscribe, but it's not necessary.
@@OneWheelStudio Thanks for fast answer, but I think that in this case when object will be enabled again you invoke Jump twice because you subscribe it again in the same instance of farmerInputActions, or maybe i'm wrong. Nevertheless video was awesome and I can't wait next video about Input system. :)
@One Wheel Studio excellent video, as always! I have a question: in 15:05, why isn't the FixedUpdate() showing the values in the console continuously rather than on button pressed? What I'm trying to accomplish is to read the value of the movement input only when the button is pressed (very much like when the jump button is pressed). And I see that on the test in 15:20 you got the Debug.Log (from the FixedUpdate) printed only when the button is pressed. With the code in the tutorial, the values are printed constantly (with no button pressed the values from the movement vector 2 are printed as 0.0, as it should be, but the problem is that is constantly printing).
Nevermind I'm stupid, the console was collapse and I didn't notice it xD But nonetheless, is there a way to read value only when the button is pressed without having to check it on Update/FixedUpdate?
That's the idea behind using the C# events (and a couple others approaches with the new input system). You subscribe to events like "started" and "performed" and the functions only get called when the buttons are pressed. For a lot of use cases you can fully avoid using Update or FixedUpdate to get input. Check out any of the videos in the "New Input System" playlist they all use this approach: ruclips.net/p/PL7S-IAgf3dlUPT3iheJaUWu-Johr8bgCk
@@OneWheelStudio thank you for the response! I'll definitely check the whole playlist out :) So far I've been implementing the "started / performed / canceled" callbacks (and I love this event system) but just for buttons. I didn't figure out yet how to use it with a vector 2, since this is a ReadValue.
Right, for things like mouse and or joystick input it's a bit trickier and I've usually defaulted back to polling the input with an Update. But you want the input every frame. So... yeah I think it's a good solution in that case.
And just for the record, the implementation for the new input system that I like is the one you used in the video: referencing the input action asset c# class on the awake function and subscribing to the perform/started/etc. callbacks, and using the input.Enable/Disable on the respective OnEnable/OnDisable functions. And because I wanted to use the Vector2 values for movement as an event rather than checking its value in an Update or fixedupdate method, I used another implementation that I don't like, which is using the InputAction component and invoking a Unity Event that calls a function that reads the value of the Vector2 (At least it gets the job done, but I would rather be cohesive and have everything done with the implementation shown in this video).
Great video. Is it possible to detect which kind of device being used, so you can switch out button prompt? Like for jump having PC: [Space] PS4: [X] Xbox: [A]
To be honest, I haven't got that far myself. But Unity has a project that might help (link at the end). The program shows how to display the name or type of device that is controlling a character. Not sure how that's done, but it might get you going in the right direction. Link: github.com/UnityTechnologies/InputSystem_Warriors?RUclips&
(Always forget, just because I am confused, doesn't mean I don't love your style of teaching, lots of people are talking about your clear and concise methodology; and I love it myself) That being said a slight woopsie, you said this is super important not to click the wrong button, but you can change it and fix it later. BUT you never say which button you should press, or which is the best setting to use, or you are using. ruclips.net/video/YHC-6I_LSos/видео.html (Guilty I guess myself, this would be the 'Yes' option) I opted to use the New System, with the backwards native, since I was going to only use this project as a test bed for the new system, and your next tutorial. I see your active input handler, under the other settings. Is set to both, I see why you would do that, but again never mentioned what you were going to do, seeing HOW important it was to not press the wrong button. I think you could have said, if you want to ONLY use the new Input system, should click yes to use the native, and disabled the old input. However in a upgraded project, use both, so you can migrate your old input. (I assume if you click no - it will default to both) This works in 2019.3 (LTS) as its the same 1.02 package as of today.
Thanks so much this was a great intro and really pushed me to dig into this and I honestly prefer this so much to the old input manager. One question though how would have different scripts for different actions? Like say I was to separate Movement and MouseLook actions into their own scripts so I can logically keep the code separated. Would I create a new reference to the input action in each script like you did at 12:50 and mentioned? Also how would I reference the base Action map in each script? Thanks!
To answer your first question, yes you would create a new reference to the input action in each script. I made another video on switching action maps and one way to do that is to create a static instance of the input action asset. So that could work too. I'm not sure I understand your second question. What is the "base action map?"
@@OneWheelStudio Sorry, I worded that bad. By base action map I meant the action map itself. So if I have MouseLook and Movement input actions in the same action map, should there be a new instance of the action map in each of those two scripts? Or should they both reference the same instance of the action map which is defined in its own script?
Ah! That makes sense. I think the answer really depends on how and what you want to implement. There are advantages to each script having there own instance - decoupled. But this also makes it hard to switch action maps and couples scritps to some sort of action map manager. So I'm not sure there is a "best way" it just depends on what you are doing.
I've been watching videos on the new input system all morning, trying to get a cube move in four directions, everybody jumps right into the c# classes and skips over explaining how the send messages works. I know it's simply writing functions to handle those events, but I'm looking for someone to hand it over to me in a nice short tutorial instead of forcing me to figure out how to get that vector2 and feed it to my rigidbody. Would you be kind and make a quick one please? Most channels don't cater to the absolute beginners fresh from installing unity.
Both my 3rd Person Character video and my Strategy Camera video are a bit more hands on. They might work? 3rd Person: ruclips.net/video/WIl6ysorTE0/видео.html Strategy: ruclips.net/video/3Y7TFN_DsoI/видео.html
@@OneWheelStudio I've set my heart on learning how the `send messages` works specially with the movement, unfortunate in both of those videos you've jumped right into the deep end and skipped that
so with 12:53 I'm slightly confused. Did you just not make it static or can input action asset variables not be static at all? Essentially, what do I do if I want an object to fire an event to something it isn't attached to? Like a trampoline that fires a "bounce" event on the player if the collidertag matches?
The input action asset can be made static if you want - I did this in another video on changing action maps. This can allow multiple objects to subscribe to events that get invoked when an input action occurs.
Man I got the jump to register and set everything up the best I could, but the console updates don't show any changes in the vector2 even when I'm pressing the WASD keys. It just keeps spamming the values as : Movement Values(0.00, 0.00) UnityEngine.Debug:Log (object) PlayerController:FixedUpdate () (at Assets/Scripts/PlayerController.cs:42) I've spent all day trying to fix this, but the menus and such are slightly different than your example, so maybe it's all messed up now?? I can't get basic WASD input to work. It also detected my USB controller but isn't registering any input on it either even in the debug screen. >.< Any advice would help... I might have to just assign separate inputs for each button, cause this vector2 stuff isn't working.
9:37 is there a reason this is done? What is even the difference between leftStick and leftStick/left? It almost seems like they should mean the same thing
They aren’t exactly the same thing. The left stick is a vector 2 and will have x and y data. Where as leftstick/left is (probably) just a singular float value and may only trigger when pressing left as opposed to any other direction.
you know things are poorly documented and overly complex when even the guy doing the tutorials struggles with it, I feel like as a unity beginner I am completely fucked lol, like all I want to do is get the value of a controller input to pass in to a variable, thats it.
Works perfect for the gamepad, but I am having problems with WASD keyboard controls. When I simultaneously press opposing directions (A+D) or (W+S), it makes the input 0. How can I fix this to where it will always set to either -1 or 1?
Rebinding is definitely doable. I actually have a video coming out tomorrow on creating a system to make it happen. The video is long and less scripted but should get most folks started.
I seemly screwed up the release of the video and need to re-upload and re-release it... In the mean time I'll leave the old one up as unlisted you can find it here: ruclips.net/video/TD0R5x0yL0Y/видео.html
I see in this video you generated a c# class but then use it to assign values to input assets in the Player script. What would be the benefit of Enabling input actions individually like this vs. just enabling the entire Generated class? Is there a clear distinction between both cases?
There's not a huge advantage. At the time of making this video that was all I knew - enabling one action at a time. Since that video, I've generally enabled entire action maps.
@@OneWheelStudio Oh ok. Thanks! Good to know. I didn't think there was but I've seen so many vids and they all seem so deliberate as to their chosen method of interacting with the Input Manager. I can't tell if it's through experience or inexperience that those choices are made so thanks for clarifying!
@@OneWheelStudio helped a lot, im familiar with .NET but not at all with unity, so I made a huge structure just to organize my actions and diferent ways they can be used (click, hold,in cooldown, realeased, and so on) but I had no idea how to recognize the inputs without using that drag and drop. So this video not only helped me to recognize input by code but also helped me to reduce my totally overkill of an input manager
my input actions require context, unlike in your thumbnail where you can simply += or bind the fucntion to the event. i just copied from the different tutorials, but i dont understand why i cant just bind a function without context
The event itself sends a CallbackContext object. So every function that subscribes to the event must have the same signature (i.e. the correct input parameters and return type). If the functions that you want to subscribe doesn't have that same signature you'll need to make a dummy function to subscribe to the event and then call the other function. If that doesn't make sense feel free to jump on the OWS discord, I'm happy to take a look at your code and try to help.
For something like that I would likely create a bool that tracks the state or similar. Then every time the key press event is performed I’d flip the value -> isPaused = !isPaused
If you're following this tutorial and can't find yourself a 2d composite
please note that unity input 1.3.0 or above, has wrap up the composite creation
on Movement(green tab) select action type from "button" to> "Value" and underneath controltype to "Vector2"
now when you right click on green tab
it will show up/down/left /right composite which is the same in this video
and you will be needed unity input 1.1.0 or above for key rebinding later on
THANK YOU
The problem with the unity new input system is that they dont know how to make a tutorial like this. Thank you very much sir, bravo!
I have watched 2 other guides on the new input system (I only just upgraded to it) and this is the best tutorial I have come across. Thank you.
Glad it helped! Do check out the whole playlist with a bunch of applications of the new input system ;)
ruclips.net/p/PL7S-IAgf3dlUPT3iheJaUWu-Johr8bgCk
Just a part way in and I can see a few things, this video is updated with new information unlike others that are heavily outdated with experimental information, the information is concise and honest / straight to the point that this new system is more complex, and its heavily detailed with suggestions of where else to look for further information with the video broken into sections. Subbed! Keep up the videos, these are really really well made.
you can use the entire "left stick" if you set the action to "passthrough" and "Vector2". Works really well for capturing those angled movements!
You can also use a Vector2 Value Action type with Composit2D binding for WASD(Tip: create a 2nd composit2D and drag bindings up to 1st one and bind arrow keys then delete empty one), and a left stick(Gamepad) binding. This is how the Unity team set up their InputActions for their free: 'Starter Assets Third Person Character Controllers' asset.
What are you guys talking about. I cant understand! Just learned some c# sharp basic when came across this..
@@MQNGameDev This. Thanks!
Thank you for putting out a wonderful tutorial that explains very precisely, without confusion the new and rather complicated Input System! Not only that, you also explain why the new Input System is superior in some cases!
Thank you very much for freeing us from the pain of confusion of the new input system!
2 years later, and this tutorial is still a life saver.
Thanks!
Adding a gamepad on the old system is super simple. Took 5 minutes and no additional code after watching a tutorial on RUclips. But this is still a good tutorial.
SUCH a good tutorial! Really clean and easy to understand, thank you! I'm super glad they built this new system as it keeps the code much cleaner and allows for a lot of flexibility in your game's input.
I have been learning this system for 2 days. I've seen some people using the Player Input component. Which made it even more complex & vague.
Your explanation and way of doing it, is the best I've encountered.
Thank you for your time & effort. :)
The player input... Didn't like that at all. Felt like a magical black box. Glad the video was helpful!
Just watched your Delegates, Events, Actions and Funcs video and this back to back and you sir, have a new subscriber. I'm trying to switch over from using the OVR input system for my first VR game and almost had a heart attack when I realised what I'd have to do to use this, but I can see how this method would clean up code across the whole project. Thank you!
Best explanation I've encountered so far. Although it wasn't what I was looking for, it does shed some light on the input system itself. Now I just have to figure out how to do this with complex UI scenes like main menu n all that.
UI is another thing for sure! Getting basic button clicks and such to work is pretty easy, but I'd definitely like to get deeper into some of the functionality. Glad the video was useful!
Thanks for the walkthrough. I was using the C# events as regular events and was getting severe performance issues. I didn't know I had to use farmerInputActions.Disable() on OnDisable() for the new InputSystem. You don't have to do that for each event [e.g. farmerInputActions.Player.Jump.Disable()], just for the input mapping file itself [farmerInputActions.Disable()]. Great video!
I just wanted to leave my "Thank you for this great explanation!" here. Will watch your other videos as well, I really like how you explain things.
I'm very grateful for this video! at the start of the month I decided to get back into making my own game again, but I put a lot of time into learning the old system and gotten use to it really well. But coming back after a year, and seeing how many people are pushing for the new system, I wanted to try and learn it and use it. How ever, it was kind of over whelming, and a lot of tutorials I tried to look up didn't really explain what a lot of the systems did (example : the action types), and I just got frustrated and stopped trying to make my game. Today I said "To heck with it" and i was going to use the old system. Before I did I decided to look up tutorials for the new system one last time just in case . Your video came up and I gotta say THANK YOU! Your tutorial was much more straight forward, and easy to understand , even more so when you explained each part did . Again, thank you so much!
Edit :
I would really like to see a tutorial on "Tank Controls" with the new input system ! I understand WASD movement, but I always liked the resident evil style control type, and I always wondered how I could use that as well. Or to be more precise , using A and W to rotate the character , and using W and S to move forward and backwards. I could never find a good tutorial on how to make my own, both in 2d and 3d games. Could you cover that controller type in the future some time please? I would love that!
yup tank controls is a cool topic
Thank you for this video! I had been wracking my brain trying to understand how to make this work and other videos I found were using the older version which was more confusing than anything! Thank you again!
Thorough walkthrough of the new input system. I stumbled upon this after fighting for 6 hours through the unity documentation which has dozens of disjointed code snippets, screenshots, and code explanations that culminates into a failure to convey any cohesive usage of their own system. HUGE Thank you for the time and effort you put into this!
It's actually surprising how bad the documentation for the new input system is. Unitys standard documentation is usually so clean, precise and has clear examples so it's weird to see it so messy
super clear explanations and i feel like i'm starting out with the complete toolbox with this system. Thanks a lot man
Upon watching your Key Rebinding I realised from this video I didn't generate my C# script, I was going crazy! I have to say though your videos are super helpful and I am 100% going to be watching more. Thank you :)
Glad they’re useful! Stop by the OWS discord and ping me if you have questions or get stuck.
Great video, loved it. Just complex enough to get the full picture but not overly complicated and confusing for someone of intermediate skill level.
great tutorials, probably one of the much better ones Ive seen over the past 6 years.
Thank you thank you thank you! I've watched hours of videos on the new system and this is the first one that made it all click.
Thank you so much!
I used this system in 3 different ways and always felt like it was not the right structure... I finally connected the dots with this video.
After official tutorial and a few YT tutorials I'm here. I hope this does it for me too! xD
Edit: Still feel super dumb. Now for another tutorial. >.>
I have tried so many different videos the last few days to get the new input player. So thanks and I will be subscribing.
I'm still not sure if I like the new input system, but I am sure that I do like your explanation of it. Thanks for the video!
thx i can finally port my game over to the new input system and now i can play with controllers
There's no "Add 2D Vector composite" option now. The only options are "positive/negative binding" and "binding with one modifier" and "binding with two modifiers". Currently on Input System 1.2.0 How do I proceed?
UPDATE: It seems having that option was a bug as it shouldn't be available for button actiontypes.
UPDATE 2: If you select "Value" Action Type and "2D Vector" as control type you have the "left/right/up/down Composite"
Omg thank you, this confused me but I found it thanks to your edit 2 :D
Thank you so much
Maybe I'm a little late, or it was said allready - but - I think the Gamepad Left Stick/Left - problem mentioned around 9:20, you can solve that issue by choosin Movement - Action Type "Value" instead of "Button". Then it should give you the oportunity to choose assign Gamepad Left Stick natively. Thank you for that nice and quick tutorial. Sorry for the crappy english xP kind regards and happy learning everyone.
Great Video! Just wanted to say thank you, as this got me a format that actually posted through as I wanted. Been banging my head on getting it working for weeks.
Great teaching style too; you've got a patron. Keep 'em coming!
So glad the video helped. And a sincere thank you for the support on Patreon! If you've got questions, or something I can help with don't hesitate to reach our and or join the OWS discord.
@@OneWheelStudio excuse me I have some unity question. somebody can help me?I am Taiwanese so my English is not well.
There’s a link the OWS discord in the description you’re welcome to pop over there and ask a question.
Thank our Father in Heaven for you sir!!! FINALLY someone explained the Input System the way UNITY SHOULD HAVE DONE IT!
Great video! Been toying around a bit with trying to understand how it functions compared to Rewired. I would love to see more on the new Input System.
Anything in particular you’re interested in seeing?
@@OneWheelStudio Interaction w/ UI is a topic I'd like to see some coverage on.
Thank you for these great tutorials. Your explanations are easy to follow.
Loved the video. Been struggling for some time with the new Input System. I would love more videos seeing how it works with Touchscreen and UI... My 2 cents.
Thank you! I just wanted to hook into the new input system through C# events, and you got me there! The documentation is so confusing.
Great tutorial, everything in one place, clear, that's it!!! Thanks, keep it up
straight to the point. very nice tutorial, thanks!
Just came across your channel and I love your videos. You explain everything properly. Thank you mate. 🖤
The dropdown menus on the control schemes are slightly different now.
I had to use Action Type : Value, Control Type: Any and then "Add Up/Down/Right/Left Composite to get the WASD key bindings set up.
This tutorial is only a few months old and it's already slightly off. :D
Life saver! Ty
Select value and control type to be vector2 will also get us the WASD binding
Perfect amount of thorough, thank you so much
very nice tutorial! thank you very much for it!
after += press double tab, event handling method will be generated
4am, i final got i figured out, thank you sir, im going to bed
Welp, I've already been working to cleanup my visual scripts, might as well put in the bit of extra effort and swap to the new input system. Then I can avoid worrying about touch vs mouse input as much.
I watched 20 fucking tutorials on the New Input System, this is the Only one I understood. ;D
Thanks.
Excellent explanation and walkthrough. Thank you for posting this.
Great professional way of teaching. Thanks. subscribed!
You explained this perfectly. Thank you so much!
I would like to know how to let the player customise the controls. That they can change the shoot button from say X to Y or from Space bar to the Enter key.
Otherwise, an excellent tutorial and presentation style. Clean and concise with solid modelling.
I've got a video on rebinding keys. Should get you headed in the right direction. Link: ruclips.net/video/TD0R5x0yL0Y/видео.html
For me a video where you create players dynamically and assign gamepads/keyboard for them would be something interesting 👍
This was very concise and helpful, thank you! I've subscribed on Patreon
please make more videos about this new system. very interesting! a day ago tryed to make a in-game zoom(by changing fov when right mouse button is held and unzoom when released) but failed and in few lines made it on ols systen)
I've got a playlist with more videos. ;) I'm also working on a split screen video at the moment. Playlist: ruclips.net/p/PL7S-IAgf3dlUPT3iheJaUWu-Johr8bgCk
@@OneWheelStudio +1 subscriber)
I'd find it interesting to see how the new Unity Input system might be used for like a fighting game style of input. Where it recognizes that doing a quarter-circle motion plus an attack button performs a 'special move'
Short answer: it's really hard. I've got something working and it's flexible enough that I can add new special moves easily (using scriptable objects) , but the reading/parsing of inputs is tricky. How do you handle charge moves? How do you handle moves that require multiple buttons simultaneously (so Forwards + Punch for example)? Then you need to think about the direction the player is facing. O_O None of these issues by themselves is, well, an issue; but keeping all the balls in the air at the same time is the tricky part. How you want your fighting game to play may make some situations a non-issue (for example, if your game won't have Lightning Kick/Hundred Hand Slap style moves, you won't need to check for rapid tap inputs) It's all possible and I'm very confident better devs than me would have better solutions. Oddly enough the actual "do these inputs match this special move?" is relatively straight forward, the hard part is not having the incoming inputs turn into an incoherent mess
@@JohnnyThousand605 yeah, I know it isn't out of the box easy. Best I've done ATM is get all my inputs to report into a byte each frame. I have four directions and three buttons combining to form the single byte. So if you were to see the byte as 8 bits, pressing left and punch would be 00100100 and down plus punch plus kick would be 01100010. Recording each frame within a limited array, combined with pop and pushing can see a history of inputs per frame. Then the moves you can issue a requirement of a set order with a number of frames accepted between specific input changes I expect. So something like quarter circle forward might be looking through recent inputs for 00000010 and then looking for 00001010 within 20 frames, if checks then look for 00001000 within another 20 frames, and say the punch can be registered up to a second later so 00100000 within 60 frames. Can be further divided by just checking first half byte for directionals and last half byte for buttons. In case where the buttons are allowed to be pressed during inputs? Dunno. But at least I think it might be workable from there.
@@PontonFSD Nice. That looks like a solid way of doing it. I'm guessing because you're using bytes it's very performant? The way I've done it is to create an enum called InputButton that can be Neutral, UpForward, Forward, DownForward etc, then made a ComboInput class that holds an InputButton variable (set in the inspector) and a function in the ComboInput class that takes an InputButton argument and returns true/false if it matches its own InputButton. Each move ScriptableObject then has an array of these ComboInputs and I can set the sequence of InputButton enums in the Inspector. There's an InputChecker class that holds a list of all the special move ScriptableObjects, sends out the current input to be checked to the special moves and receives a response from each. Any that return false (ie, the input is not that special move's next valid input) are relegated until the next frame, but if a move reaches the last of its valid inputs it triggers the actual special move. This is a proof of concept/demo bitglassgames.itch.io/block-fighter
@@JohnnyThousand605 block fighter is not working on mac bro
This was an extremely well-explained tutorial. I'm probably going to stick with the traditional input system since I'm only using a few very simple button presses, but this is worth looking into in the future.
Same here
I do think for simple implementations especially for keyboard and mouse there is no real reason to migrate to the new system.
Instead of subscribing directly to each action please use SetCallbacks which are ready for you inside your generated c# class. Great tutorial but I would like to see more in-depth tricks because like you said more of the videos do that.
@@OneWheelStudio I'm not sure but one day I checked Unity open project and they use it in some nice way maybe you can find something interesting there for new video because they constantly creating this project. Also I try to do some Vector button on int but I think there is no option for that and I must cast from float or made separate two actions or I just cant handle this.
awesome video! thanks a lot!
Unity 2020.3 can now be used with the new Input System, it was recently updated :D
thanks for this video all the other explanations i found online used that player input behavior which never works for me.
finally a worthy tutorial
This helped me a bit on the way. I would have found it a lot more useful if you had split the video into two parts, one for a general explanation of the input system and another where you go into more detail about subscribing to c# events. For instance, as of this point I'm still not sure how to subscribe to an action without directly subscribing to the phase through c# events.
you are really good content, keep up good!
Nice concise tutorial, a tutorial on alternating Action Maps would be grate, also, switching key binding at runtime like in a settings menu.
Both great topics - definitely needed if the system is going to be used in a production project!
Can you make a video how to trigger ui buttons in unity using the new input system with keyboard and gamepad. I am asking because i got really trouble using the gamepad there. The ui button looses the focus and the on click default event of the button is not raised using the gamepad. Using the keyboard is not a problem. I turned off the mouse control at all. That is because my game is foreseen for mouse control. But on top when mixing mouse and gamepad then will the the gamepad trigger the ui button only as expected when the mouse pointer is on the buttons position. Otherwise the button just loose focus because the mouse button is outside a user control area. But when turning off the mouse and also ensure in code that any ui control is focussed always, it will losse still the focus by triggering the gamepad button to raise the on click event of the ui button. Would be perfect to see such video how to control ui buttons and ui toggles checkboxes.
thank you so much!
My experience with the new input system so far is that it caused the fans to start whirring on my 3900X while producing choppy, erratic movement that just felt lag-tastic.
That’s definitely strange and seems like something is wrong. If anything performance should be a bit better as you don’t have to poll inputs every frame. If you’ve got code that you know is causing the issues feel free to drop by the OWS discord and share it. I’d be interested to see what’s going on.
freaking great tutorial. exactly enough.
Hey there, is there a simple way to modify the action processors via script at runtime? For example a ScaleVector2 for a camera input. I can't find a solution that is working for me. Also, i am using the Cinemachine Input Provider with a CinemachineFreeLook camera if you know about any restrictions in this context.
Great video as always and thanks!
Update: On verified verion 1.0.2, touch's release does not recognize inside game view. On preview 5 version 1.1.0, touches does not even get recognized T~T.
Hey, I'm new here and I have a question:
I found how to create a input action with a modifier(Shift) which is Shift+Right Mouse Button, but now my other action with only Right Mouse Button(no mods) is also triggering at the same time. How to I prevent my RMB action to trigger when I use my Shift+RMB?
And thanks for all the content about the New Input System, its been really helpful.
Hmm. This isn't something I've dealt with yet. So I did some research. From what I can tell is Unity hasn't resovled this problem!!! There are work arounds. Here's one that seems to make sense and I've seen others reference. If you find a good solution I'd love to know what it is.
Link: stackoverflow.com/questions/65546739/new-unity-input-system-is-there-a-way-to-not-execute-an-action-if-a-modifier-i
Loved this.
On the subject of the video itself, it would be nice to see a demonstration of how to work with swapping between different action maps, when using the C# events approach instead of the built-in controller. I had a good bit of difficulty with that in one of my projects.
Done! ;)
Try this video: ruclips.net/video/T8fG0D2_V5M/видео.html
@@OneWheelStudio Sweet. Looks like a nice clean approach. Thanks.
Blog post on the New Input System: onewheelstudio.com/blog/2021/5/8/unitys-new-input-system
Version 1.0.2 of the input system was used along with Unity 2020.3
***See the conversation with Dave below, for a possible issue re unsubscribing.
Thas was a great tutorial!
Great explanation mate! Can you please create a video explaining how to use multiple interactions on the same input binding.
Example: Jump on "Tap" and SuperJump on "SlowTap/Hold" both on the "space" key. Especially regarding, on how to update a value of a variable. Like, it should only be able to jump twice. I'm seeing an issue (bug or bad implementation?) where the value "jumpsRemaining" variable is the old one, instead of the current one, hence I end up jumping maxJumps + 1 instead of just maxJumps. I wonder if this is something to do with the event system itself using old values? But I am not sure on the keywords to research this problem further.
These are great questions! The nitty gritty of the system is not simple that's for sure.
I think a good starting point would be to look at the CallbackContext documentation. This is the type of the parameter that is sent in the event. I basically ignored it in the video, but you can get all kinds of info about the event from it. Link: docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.InputAction.CallbackContext.html
You may also read up on the interactions to create tap and or press and hold functionality. Link: docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Interactions.html?q=interactions
Based on what you are describing you may also need to subscribe to multiple events - started, canceled and performed. When these events are invoked they can start or end timers that are then monitored and functions called based on the timer. For example if the time between started and canceled is short you do the short jump or if it's long you do the power jump.
Hopefully one of those ideas gives is helpful and moves you in a good direction.
@@OneWheelStudio Thanks. I managed to stumble across the same docs you linked earlier today. The Update/FixedUpdate loop was running immediately after firing the event which would overwrite my variable. Fixed it by subscribing to multiple interactions like you pointed out and switched to using TriggerEnter2D which seems to fire something like an event(?), And is not dependant on being polled. I guess that's what you get for mixing event based systems will polling architectures...
Glad you got it working. The flexibility and power of the system goes both ways. Lots that can be done and lots that can be done wrong 😛
Really like your shirt. Any idea where you got it?
I do happen to know where I got it ;)
Link: onewheelstudio.com/merch/
Please do more videos about Unity Input System, maybe one about using it with touch and gestures. ;)
Question
If you're add DoJump method to the Jump event in the OnEnable handler, then you shouldn't remove it in OnDisable handler?
In general, whenever I subscribe to an event in OnEnable I ALWAYS unsubscribe in the OnDisable, but in this case, when you call "Disable" on the input action the events will not be called and since the Input Action Asset is a local instance there's no risk of invoking the event when the object is disabled or destroyed.
So I think you very much could unsubscribe, but it's not necessary.
@@OneWheelStudio Thanks for fast answer, but I think that in this case when object will be enabled again you invoke Jump twice because you subscribe it again in the same instance of farmerInputActions, or maybe i'm wrong. Nevertheless video was awesome and I can't wait next video about Input system. :)
@@D-Dev I think you are 100% correct!
I love this channel
Key Combinations
Timed Actions etc
It's on my list! Not sure when it'll happen, but its on the list ;)
@@OneWheelStudio Nice! Thanks for the effort
problem with this implementation : it doesnt use maps, and i'd like to use maps.
What do you mean by "maps?" The system uses action maps?
@One Wheel Studio excellent video, as always! I have a question: in 15:05, why isn't the FixedUpdate() showing the values in the console continuously rather than on button pressed?
What I'm trying to accomplish is to read the value of the movement input only when the button is pressed (very much like when the jump button is pressed). And I see that on the test in 15:20 you got the Debug.Log (from the FixedUpdate) printed only when the button is pressed. With the code in the tutorial, the values are printed constantly (with no button pressed the values from the movement vector 2 are printed as 0.0, as it should be, but the problem is that is constantly printing).
Nevermind I'm stupid, the console was collapse and I didn't notice it xD
But nonetheless, is there a way to read value only when the button is pressed without having to check it on Update/FixedUpdate?
That's the idea behind using the C# events (and a couple others approaches with the new input system). You subscribe to events like "started" and "performed" and the functions only get called when the buttons are pressed. For a lot of use cases you can fully avoid using Update or FixedUpdate to get input.
Check out any of the videos in the "New Input System" playlist they all use this approach: ruclips.net/p/PL7S-IAgf3dlUPT3iheJaUWu-Johr8bgCk
@@OneWheelStudio thank you for the response! I'll definitely check the whole playlist out :)
So far I've been implementing the "started / performed / canceled" callbacks (and I love this event system) but just for buttons. I didn't figure out yet how to use it with a vector 2, since this is a ReadValue.
Right, for things like mouse and or joystick input it's a bit trickier and I've usually defaulted back to polling the input with an Update. But you want the input every frame. So... yeah I think it's a good solution in that case.
And just for the record, the implementation for the new input system that I like is the one you used in the video: referencing the input action asset c# class on the awake function and subscribing to the perform/started/etc. callbacks, and using the input.Enable/Disable on the respective OnEnable/OnDisable functions.
And because I wanted to use the Vector2 values for movement as an event rather than checking its value in an Update or fixedupdate method, I used another implementation that I don't like, which is using the InputAction component and invoking a Unity Event that calls a function that reads the value of the Vector2 (At least it gets the job done, but I would rather be cohesive and have everything done with the implementation shown in this video).
Great video. Is it possible to detect which kind of device being used, so you can switch out button prompt? Like for jump having PC: [Space] PS4: [X] Xbox: [A]
To be honest, I haven't got that far myself. But Unity has a project that might help (link at the end). The program shows how to display the name or type of device that is controlling a character. Not sure how that's done, but it might get you going in the right direction.
Link: github.com/UnityTechnologies/InputSystem_Warriors?RUclips&
(Always forget, just because I am confused, doesn't mean I don't love your style of teaching, lots of people are talking about your clear and concise methodology; and I love it myself)
That being said a slight woopsie, you said this is super important not to click the wrong button, but you can change it and fix it later. BUT you never say which button you should press, or which is the best setting to use, or you are using.
ruclips.net/video/YHC-6I_LSos/видео.html
(Guilty I guess myself, this would be the 'Yes' option)
I opted to use the New System, with the backwards native, since I was going to only use this project as a test bed for the new system, and your next tutorial.
I see your active input handler, under the other settings. Is set to both, I see why you would do that, but again never mentioned what you were going to do, seeing HOW important it was to not press the wrong button.
I think you could have said, if you want to ONLY use the new Input system, should click yes to use the native, and disabled the old input. However in a upgraded project, use both, so you can migrate your old input.
(I assume if you click no - it will default to both)
This works in 2019.3 (LTS) as its the same 1.02 package as of today.
Thanks so much this was a great intro and really pushed me to dig into this and I honestly prefer this so much to the old input manager. One question though how would have different scripts for different actions? Like say I was to separate Movement and MouseLook actions into their own scripts so I can logically keep the code separated. Would I create a new reference to the input action in each script like you did at 12:50 and mentioned? Also how would I reference the base Action map in each script? Thanks!
To answer your first question, yes you would create a new reference to the input action in each script. I made another video on switching action maps and one way to do that is to create a static instance of the input action asset. So that could work too.
I'm not sure I understand your second question. What is the "base action map?"
@@OneWheelStudio Sorry, I worded that bad. By base action map I meant the action map itself. So if I have MouseLook and Movement input actions in the same action map, should there be a new instance of the action map in each of those two scripts? Or should they both reference the same instance of the action map which is defined in its own script?
Ah! That makes sense. I think the answer really depends on how and what you want to implement. There are advantages to each script having there own instance - decoupled. But this also makes it hard to switch action maps and couples scritps to some sort of action map manager. So I'm not sure there is a "best way" it just depends on what you are doing.
Ahh thanks that's helpful I appreciate it. Thank you for making all these videos as well I really appreciate the time and work you put in
I'd like to see how to make something like a complex input like mortal kombat special moves for example (down + right + punch)
That’s on my to do list! No promises though 😉
if u hold space bar it'll still debug "jump" so its really bad i tried fixing it with tap interaction but its not a perfect solution
I've been watching videos on the new input system all morning, trying to get a cube move in four directions, everybody jumps right into the c# classes and skips over explaining how the send messages works. I know it's simply writing functions to handle those events, but I'm looking for someone to hand it over to me in a nice short tutorial instead of forcing me to figure out how to get that vector2 and feed it to my rigidbody. Would you be kind and make a quick one please? Most channels don't cater to the absolute beginners fresh from installing unity.
Both my 3rd Person Character video and my Strategy Camera video are a bit more hands on. They might work?
3rd Person: ruclips.net/video/WIl6ysorTE0/видео.html
Strategy: ruclips.net/video/3Y7TFN_DsoI/видео.html
@@OneWheelStudio I've set my heart on learning how the `send messages` works specially with the movement, unfortunate in both of those videos you've jumped right into the deep end and skipped that
@@KiaAzad That's fair. I never really looked at a method beyond C# events.
there are no 2D Vector composite in Input system now
so with 12:53 I'm slightly confused. Did you just not make it static or can input action asset variables not be static at all? Essentially, what do I do if I want an object to fire an event to something it isn't attached to? Like a trampoline that fires a "bounce" event on the player if the collidertag matches?
The input action asset can be made static if you want - I did this in another video on changing action maps. This can allow multiple objects to subscribe to events that get invoked when an input action occurs.
I really would like to see how to swap between Action Maps. It's so complicated but necessary.
Gotcha you covered: ruclips.net/video/T8fG0D2_V5M/видео.html
Man I got the jump to register and set everything up the best I could, but the console updates don't show any changes in the vector2 even when I'm pressing the WASD keys. It just keeps spamming the values as :
Movement Values(0.00, 0.00)
UnityEngine.Debug:Log (object)
PlayerController:FixedUpdate () (at Assets/Scripts/PlayerController.cs:42)
I've spent all day trying to fix this, but the menus and such are slightly different than your example, so maybe it's all messed up now??
I can't get basic WASD input to work. It also detected my USB controller but isn't registering any input on it either even in the debug screen. >.<
Any advice would help... I might have to just assign separate inputs for each button, cause this vector2 stuff isn't working.
I'm having the same problem. I am using InputSystem 1.1.1 in Unity 2022.1.0a13.
I think I'm gonna watch this like 10 times until I understand xD
As many as it takes ;)
Happy to answer questions here or over on discord too (link in the description).
9:37 is there a reason this is done? What is even the difference between leftStick and leftStick/left? It almost seems like they should mean the same thing
They aren’t exactly the same thing. The left stick is a vector 2 and will have x and y data. Where as leftstick/left is (probably) just a singular float value and may only trigger when pressing left as opposed to any other direction.
12:48 I actually tried to close that notification at the bottom right
you know things are poorly documented and overly complex when even the guy doing the tutorials struggles with it, I feel like as a unity beginner I am completely fucked lol, like all I want to do is get the value of a controller input to pass in to a variable, thats it.
Wanna see more even more detailed tutorial... still a bit confused cheers!
Totally get that. Anything in particular you want to see?
Works perfect for the gamepad, but I am having problems with WASD keyboard controls. When I simultaneously press opposing directions (A+D) or (W+S), it makes the input 0. How can I fix this to where it will always set to either -1 or 1?
Is there a way for players to modify the keybinds with this or are players "locked in" with the scheme that players are with in this setup?
Rebinding is definitely doable. I actually have a video coming out tomorrow on creating a system to make it happen. The video is long and less scripted but should get most folks started.
@@OneWheelStudio Nice!
I seemly screwed up the release of the video and need to re-upload and re-release it... In the mean time I'll leave the old one up as unlisted you can find it here: ruclips.net/video/TD0R5x0yL0Y/видео.html
I see in this video you generated a c# class but then use it to assign values to input assets in the Player script. What would be the benefit of Enabling input actions individually like this vs. just enabling the entire Generated class? Is there a clear distinction between both cases?
There's not a huge advantage. At the time of making this video that was all I knew - enabling one action at a time. Since that video, I've generally enabled entire action maps.
@@OneWheelStudio Oh ok. Thanks! Good to know. I didn't think there was but I've seen so many vids and they all seem so deliberate as to their chosen method of interacting with the Input Manager. I can't tell if it's through experience or inexperience that those choices are made so thanks for clarifying!
Finally some actually useful content and not another "the new input system for people afraid of coding"
I might get a lot more views if I went that direction 😛 I hope the video was useful.
@@OneWheelStudio helped a lot, im familiar with .NET but not at all with unity, so I made a huge structure just to organize my actions and diferent ways they can be used (click, hold,in cooldown, realeased, and so on) but I had no idea how to recognize the inputs without using that drag and drop. So this video not only helped me to recognize input by code but also helped me to reduce my totally overkill of an input manager
my input actions require context, unlike in your thumbnail where you can simply += or bind the fucntion to the event. i just copied from the different tutorials, but i dont understand why i cant just bind a function without context
The event itself sends a CallbackContext object. So every function that subscribes to the event must have the same signature (i.e. the correct input parameters and return type).
If the functions that you want to subscribe doesn't have that same signature you'll need to make a dummy function to subscribe to the event and then call the other function.
If that doesn't make sense feel free to jump on the OWS discord, I'm happy to take a look at your code and try to help.
Can you show how to Toggle Keys in new Input System? For Ex.: Esc key to toggle between Pause & Resume.
For something like that I would likely create a bool that tracks the state or similar. Then every time the key press event is performed I’d flip the value -> isPaused = !isPaused