 All right, so let's go and install the new input system We're not going to be using the old input system, you know where you would do like input dot get access or anything like that We're gonna actually use this to set up, you know, multiple mappings So we can use the keyboard and the Xbox controller, which you know, it'll save us tons of time So let's take a look at how to get this done Okay, so what we need to do first is we need to come up here to window and we need to go to the package manager And what we want to do is we want to look for the input System there it is. So this one definitely requires that we have this show preview packages on Because it's still in preview. All right And so I'm just gonna select that and install that and this will take just a little bit And I'll be right back. All right, so finished installing what it's telling us now is that we need to Restart the editor because it requires a restart. So I'm just gonna select yes and Unity is going to finish installing and then shut down the editor for us and Get things rolling. All right. I actually had to go and restart it myself But I in the past it's actually restarted for me this time. I just needed to restart it again It's still in preview. So Now what we have the ability to do is inside of assets down here in our project tab over here If we just right-click and say create come all the way to the bottom There should be this new input actions Asset type for you and this allows us to then you know set up and map our control So let's take a look. I'm actually going to call this drone inputs All right And what we can do is we can double-click on it to launch this editor where we go and set up our action maps Or we can go and click on this in the inspector over here and bring that same window up like so All right, so inside of here. We can go and add a new action map All right So I'm just going to click the little plus button right here and I'm going to call this drone All right, and you can have multiples in these and you'll see later down the road here We can actually switch between these really fast inside of the inspector in the player input component All right, but for now, let's just focus on creating just the one and we're going to make you know some new action here And so what I want to do is I'm going to call this You know something like move. All right, and so I'm just going to delete the Initial mapping there and what we've done is we set up this input action. All right, and I'm going to put this to let's put it to a value and Let's add a 1d axis component. All right, so let's do that This allows us to set up, you know, like a negative and positive type key so we can just call this We'll call ad something like that because what I want to do now is select one of these guys All right, so for the negative input, I want to set the type of input that we want All right, and so you have a bunch of options to choose from in here All right, so we have the gamepad joystick keyboard mouse pen pointer bunch of stuff in here, which is awesome We don't have to actually code it ourselves anymore all right, and so in this case I want to use the keyboard and Then we can go and you know select, you know all the different keys in here Or you could just use the search in this case since I know the key that I want I'm just going to put in a and then you can see down here in the list. It's available for us All right, so then I'm going to go and select the positive here, and I want to do D And we want to get the D keyboard. All right, and what's really important You just need to make sure that you're always saving this you can turn on the auto save But I you know just out of habit. I've gotten into you know the habit of hitting the save asset button constantly I've also been docking it up here the more and more I use it and I just kind of leave it up As I you know work on controllers and stuff like that inside of unity. All right, so now we've got that all set up We want to just test to see if this is working. So we could do a really quick test here I can come over here into the hierarchy panel and Right-click and say create empty. We'll just call this test input like so and What we need to do is we need to Create some sort of script. So I'm just going to create some throwaway scripts So I'm just going to right-click on assets here and go to create new C sharp script And we'll call this test input as well All right, I'm just going to delete this later on I just want to show you guys how to access the input values that are now coming through our Input actions over here. Okay, and so let's double-click this guy. We're going to launch visual studio All right and what we want to do is we want to Get the inputs right we want to actually read that value and so in order to do this Let me actually go back to you here really quick in order to do this on our actual game object Or you know, we're going to be controlling something with input We need to include a new component called player input. All right, so we need to say player input like so all right and What we need to do is we need to sign our actions that we just created so we created an action map right here So we need to sign that asset that's over here in the project Not our script our drone inputs. We need to assign it there All right, and you'll notice now we have the ability to pick a default map All right, so we can have a bunch in here and dynamically just switch it using this little drop-down Super useful super quick. It's also set to a behavior of send messages Okay, and you know when you're just starting out This is a good one to use. All right, and then below that you'll notice all the messages that it's going to be sending So these are basically callbacks. You can listen for all right in your scripts I'll as long as this component is on the same game object as a script that's listening for these messages Okay, so hopefully that makes sense. So the one thing you should take note of is we have this on move Message and that is referring to this action that we set up this input action Okay, so in our script now with all that information in our brains in that script now what we can do is we can create that or create a function with that same name on move and retrieve the Input values, okay, so we're going to say avoid on move. All right, and these particular Messages require that you have one argument and I didn't want to use on animator move We need one argument and that's that input value But you'll notice that it doesn't show up right away and that's because I need to be using the namespace All right, so I'm going to come up here and say using Unity engine dot input system Now we have access to all that particular code that is Specific to the input system the new one. All right, so now what we can do is come in here and say Input value and we'll just call it value. It's the usual Then you can name it or whatever you want All right, and then what we want to do let's just debug that we'll say debug Dot log and we'll say value dot Get all right, so we use get so we need to tell what type of value we're going to get in this case If I go back to Unity over here We're just getting a Single value. All right, so we just have a single value. This is going to return negative one and one for me All right, so let's go up here and we're going to do a float inside of there parentheses Like so and then so I call in so now this will basically print out that float value. All right, so let's save Our script go back to Unity All right, and let it all compile And let's go to the console and let's just make sure let's hit play and make sure we're getting that value And it's usually helpful To go and put the script onto the component like so. All right, so let's do that and Let it play and there you go. So in the console now you can see I'm getting negative one one All right, and there's a lot of stuff you can do with this So we'll talk more about this as we get further along. I just wanted to show the general use You know installing it Getting a new Asset created input asset and then you know creating your own action map So that's basically how we start to work with the input system. All right. Thanks so much