In this lecture, we'll discuss the Unity Input Manager. And before I even tell you anything about it, you should go do an in-video quiz to see if you can guess what it's for. Okay, the Input Manager is for managing inputs. And it lets us do a number of interesting things. It lets us map named input axes to particular inputs. So, for example, we can name an input axis horizontal and map it to the A and D keys for left and right to move horizontally. It also lets us check for player input from within our script, and that's really helpful because we react to player input in our games all the time. Another thing the input manager lets us do is it actually lets players remap the input so if they don't like using A and D for left and right, if they would prefer using W and S for left and right, then they can do that. Okay, let's go to Unity and see how we use the Input Manager. So this is a pretty basic scene in Unity. All I have is the default scene with the main camera. I have saved it in a scenes folder as scene0. So the way we get to the Input Manager is we say Edit > Project Settings > Input. And over here in the Inspector, you see we have the InputManager and the list of the axes that come by default. And of course, that list looks empty until you hit the arrow next to it. And then you see that there are 18 axes that we get, by default. So let's look at the horizontal axis, this named axis. So as you can see, we can edit names of the axes to make them appropriate for us. And each axis has the potential for a negative button and a positive button. And an alt negative button, and an alt positive button and then some other settings. So, for this horizontal axis, the negative button is the left arrow key, so we move it negative in the x. We move to the left if we press left arrow key. And we move to the right if we press the right arrow key. And then these alt negative and alt positive buttons, are also going to work in the negative and positive direction. So this is pretty much your default keyboard, moving horizontally control scheme. Down here in the type of input, we are most commonly going to use key or mouse button. Though we will see when use a game pad if we choose to use a gamepad, we'll often use joystick access as well. But we certainly use key or mouse button if we were getting the buttons off of a controller or a gamepad. The other thing that is really interesting is this axis is named horizontal, but if we scroll down, we will see there's another horizontal named axis. And this one is in fact a joystick input. And this is set to be joystick axis, so it will be the horizontal axis on a thumb stick, on a gamepad or a controller. And under Joy Num, it's set to get motion from all joysticks, but we can actually pick which joystick we get input from. If you leave it as get motion from all joysticks, any joystick that's connected can provide this input. Now this is pretty awesome, that we have multiple axes named horizontal. Because within our scripts, we don't care what provided that horizontal input. It could've been the keyboard, it could've been a joystick. We don't care. All we do is we check for input on that particular axis, and we'll see that in the coming lecture. And we don't care how it came in, we just know we're responding to horizontal input. And that's pretty fantastic because it separates what the mapping is to the input axis from the actual processing we do within our scripts. The other thing I said we can do is we can have the player change that mapping when they actually run the game. Let's do that, but before we do that we actually have to build the game. So here on the upper left of the menu, I will say File > Build Settings, and I get this dialog. And the scenes in the build is empty, so I'm going to click Add Open Scenes. And now seeing0 is in the build. I'm going to leave this build for PC, Mac, and Linux Standalone, though you can build for WebGL as well and you will as you submit games for other people to play in the course. But we'll leave it as standalone for now. I'll leave it as Windows x86 and then I'll even say Build And Run. So, it's going to build this for me and then it's going to run the player for me. I click that button, and I get a file dialog that says, where do you want the build to be? I'm actually going to put it in a new folder that I'll call Build. So now I'll put the name of the file for my executable and I'll just call it InputManager. And then I'll save. And then you wait patiently while it builds the player. Now once it's done building the player, here's the window that popped up. You can see that I can set the resolution for my game, I can change that if I choose to. I can set whether it's going to windowed or not when I run it. I can affect graphics quality and which monitor it displays on and so on. But this Input tab is the one that we're interested in for this conversation. Because here are those mappings. Here is the horizontal positive and alt positive for right and d and negative and alt negative for left and a, and so on. And if the player wants to change one, all I have to do is double-click an entry to change. So I can double-click right. And then I press a button, say, y, and now one of my positive horizontal inputs is y, instead of right. And so, this makes it very easy for the player to remap how they want the control scheme to work. And it's all because we're using the Input Manager with named input axes. To recap, in this lecture, we learned some of the ideas behind the Unity Input Manager and how we can use it to map named axes to inputs so we can set up the control scheme for our game.