In the previous lecture, we converted our mouse button processing to use a named input axis. And that led to some problems because we're responding to more than the input on the very first frame in which that input occurred. So let's go to Unity, and fix that now. Okay, remember that our problem here, is that when we run our game, we have a character follow our mouse around. But if I left click to change character, I get multiple changes. And that's because I'm processing more within the first frame of input on my change character axis. So let's go to the character changer script and fix that. The big idea here is that we're going to need a flag, a boolean variable, that keeps track of whether or not we had input on the previous frame. So, let's add the field for that, first frame input support. So this will be a boolean. And while you might be tempted to use a shortened name because you believe you'll remember what that name meant six months or a year from now, let's make it so that we actually have a good descriptive field name here for the flag. So we'll call it it previousFrameChangeCharacterInput. And that tells us exactly what we're talking about here. Did we have ChangeCharacteInput on the previous frame? And we'll initialize it to false because when we start the game, we didn't have input on the previous frame to change the character. Down here in the Update method, remember, the first thing we do is we check to see if we have input on that input axis. And if we do, we're doing some stuff. But if we don't, now that we are using this flag, we need to clear the flag to say we didn't have input on the previous frame. So let's clear that flag here, it's way down at the bottom, and add an else to the if statement that's checking for that input. And you can tell that you're matching the right if statement because the open curly brace that matches this closed curly brace that my cursor is right next to is highlighted. So we'll add an else. And remember, we don't have any input here. And we're a long way away from the Boolean Expression that checked that. So I'll say, no change character input as a comment, even though I'm only commenting a single line of code here. So for the previousFrameChangeCharacterInput, I'll set it to false. So here's how this works. We run this Update method and we may set this flag to false here. And so, because this is a field, not a local variable in the Update method, the next time the Update method is called on the next frame of the game, this flag is set or cleared. It's true or false. And so, we're actually saving information here for later frames in the game because we know update gets called every frame. The only other change we need to make is here. If we do have input on that axis, we still don't know that we want to change the character. We only want to change the character, only character on first frame. I'll say first input frame. So we only want to do this if not PreviousFrameChangeCharacter. And I'll add the clues curly brace where it belongs down here. So this boolean expression might look a little strange to you. You might think you should check if previousFrameChangeCharacterInput equal equal false. Which you can certainly do, but remember, not true is false and not false is true. So the only way this evaluates to true is if the flag evaluates to false, which is exactly what we want. Now, the first thing I need to do here is, actually set this flag now, so that we know we've processed that first frame of input. So, we'll say, the flag is now true, because next time update gets called, on the next frame in the game, this flag will be set to true. And we will know we already processed that first frame of input. So this will now evaluate to false even though we're still getting input on the ChangeCharacter axis. So we won't try to change the character multiple times. So back in the editor, when I run the game now, I can click and I only got one character change. And, of course, I got multiple of the same there just because of random numbers. But I can hold the left mouse button down and it still only responds to that first frame of input. So we've solved our problem. To recap, in this lecture, we fixed our mouse button processing code so that it only responded to input on our named input axis change character, on the first frame in which that input was provided. This is actually a more general approach that also works with keyboard keys and controller buttons, and so on. So the idea of how we make sure we only process the first frame in which an input was provided, is pretty powerful and we learned how to do that today.