 Let's now turn our attention to creating the input controller script. Alright, so this is going to be the actual script that retrieves all the values from our input system. Alright, so let's go and create our first script over here, and we're going to do a couple of things here. So, inside of our code folder, I'm going to go and add a new folder called editor. Alright, that's just going to be for anything editor related that we might script, and then we're going to do scripts. This is for all gameplay related typescripts. Okay, so in here, what I want to do is I want to go and create a new C-Sharp script to just right click on the scripts folder. And we're going to call this IP drone inputs, something like that. Obviously, you can name it whatever you want. But definitely try to maintain some sort of naming convention for all this stuff, just to keep your own sanity. Alright, so I'm going to double click this guy, launch it inside of visual studio. And the first thing that I usually do in here is I'll put this into a namespace, so we're going to put it into an indie pixel namespace. And let's just make sure that, you know, our code is basically protected from any other script that might have the same name, basically. So it's just a good idea to put it inside of namespace, just protects your code. Now we know we're going to be working with the input system. So let's go ahead and add the unityengine.input system namespace in here. So we have access to all those code, all that code and all those classes and parameters and stuff like that. Okay, so let me actually make this a little bigger for you guys as well. And maybe collapse some of these guys since we don't really need to see any of that stuff. Alright, so I'm going to come in here and we're going to do a region and I'm going to put all my variables inside of this region. And I like to do that just to, you know, stay organized with my code. And then all this stuff, this is going to be all of our main methods, though we're not going to be using start. Not that I think at least we can always put it back if we do end up needing it for anything for now. Well, I really just need update because we might be updating some values. So we'll just keep that in there for now. Alright, and so what we want to do is declare a bunch of private variables. Alright, so I'm going to say private. Actually, the first one is going to be our cyclic value. And so that's going to be a vector two. And remember, we set that up as a vector two inside of our drone inputs over here. So it's a vector two. Alright, so we want to get that cyclic value. So if I go back to my code over here, we're going to call this cyclic just to keep it nice and simple. Alright, and so then we need another one for our pedals. So this is going to be a float value because it just goes from negative one to one. Alright, so do pedals like so and we'll do another private float and we'll call this one throttle. Alright, very cool. Alright, so what I want to do is I want to give other scripts the ability to get the values from this. Now we currently made all these private variables, which means only this script, only this drone input script can access those variables. They're basically protected inside of that one class. And so what we need to do is we need to create properties for these C sharp properties. Alright, so there's a really easy way to do it. You can just, you know, highlight one of the variable names, right click and go to your quick actions and refactorings. We can go and we can say generate the encapsulated field and use a property. Alright, look at that. It automatically generates the property code for us. Now in this case, I don't want any other script to actually set it. I just want to get the value. So we're going to get rid of the set call there. Alright, very cool. So let's do the rest. So let's do pedals. So I'm going to say quick actions and refactorings. And then we're going to do encapsulate field and we'll get rid of that set call as well. There we go. And then let's do the throttle. Alright, very cool. So it saves us a lot of time from having to write the code ourselves. Very cool. Alright, so with that all done, all we really need to do now is to set up our, and I forgot the region here. Alright, so my first clue is I had a little red squiggly line there at the bottom. Usually means that one of your regions hasn't been closed up. Alright, so like I said, what we need to do now is we need to actually get the values. Alright, from our input system. So like we saw in our previous video, let's go and make a region. We'll call this input methods. We'll close that guy out. And the way that we do that is we need to get the function name, alright, which is going to be onCyclic and onPetals and onThrottle. Alright, and we also need to basically go and set up our player input. So I'm going to first just focus on doing the script here. So what we need to do, let's come back to our code over here, and we're going to do a private void. We're going to say onCyclic, like so. And we'll go and put in our curly brackets there. Alright, so remember we need to put in the input value argument here. Let's call it value. That allows us to retrieve the value that's being sent through that message. And then all we need to do is we need to set the cyclic to that. So we'll say value.get, and this is a vector 2. Alright, and there we go. Easy as that. Now we need to go and set up the petals. So we'll say private void onPetals, like so. And we need our input value. There we go. Call value. And now we set our variable. So we'll say petals is equal to value.get, and that's a float. So we'll get that float. And then we'll do the same thing for our throttle. We'll call void onThrottle. And we'll say input value. We'll call that value. There we go. And we'll say throttle is equal to our value.get. Alright, and this is a float value as well. Awesome. And there we go. So now we have all of that set up. Okay, so what we need to do now is, I'm going to come up to the top here, and because I know that I'm always going to need a player input component for this particular script to work, I'm going to add a require component up here. So we're going to say require component, and we're going to say type of, and then we're going to do player input, like so. Alright, that means that when I go and drag and drop this script onto the game object, in this case our drone, it's going to automatically check to see if a player input component is assigned to our game object, and if not, it's going to make one for us. So it just helps us even more with efficiency. It sets it up for us. So let's go check all this out. Okay, cool. So what I want to do, let's go to the scene over here. I'm actually going to nest all the art below an empty game object. So let's go make empty game object here. And this is going to be called our drone. Okay. And I'm going to center it up in the world. So just right click, or actually just click this guy right here and say reset. Alright, that way they're at the same exact position there. Then I'm just going to drag and drop the drone in there. I tend to do this. I'll put all the components on this empty game object, then just keep the art underneath it, because we don't need to actually attach scripts to our art. That's just there for aesthetics. It's just a visual display. Alright, so now what we can do is we can go and drag and drop our drone inputs, script onto this drone root or parent game object. So let's just click and drag that on there. And look at that. It automatically added our player input and the drone input script. So it's just, it's setting stuff up for us. Super cool. So if you remember from the last video about the input system, we need to assign our actions. So let's go to our input. We'll just go and assign it like so. You can also hit this little button right here and pick it from the assets. Alright. And we will select our default map. Very cool. Alright. And let's go back to our drone inputs and make sure that we save our asset. So the reason why I noticed that I hadn't saved it is because the functions weren't visible here. Now that I've saved the asset, you can see that onCyclic, onPedals, and onThrottle are now messages that are going to be sent by the player input. And they're going to be sent to this drone input scripts because we are listening for those using these methods. Okay. Cool. So we got our input script all set up. We are now good to go. Everything is a working. Alright. We can always go and test this stuff out too. We can go to set this to debug. That way you can actually see your values here. And we can hit play. And we can go and test out our WASD. And there we go. We're getting our cyclic values. Very cool. Test it out on the Xbox controller. That's working. Yeah. All that's working. So Throttle's working. Pedals are working. Let's test out the arrows on the keyboard. That's working. In this case, you know, this particular controller, it's going to be way better to use the Xbox controller. But I want to make sure that, you know, if you don't have one, you can still use the keyboard. Alright. So we are working. Let me turn our debug mode off. Go back to normal there. And there we have it. Alright, so let's move on to the next lecture.