Welcome back everyone in the last video we got to a point where we are able to interact with our skill Dyess, we're able to pause the game, we're actually creating this w BP skill acquired widget, although it's not showing due to that Widget Blueprints, animations not firing yet. In this one, we're going to make it so that our player can remove this skill acquired a widget that you can't currently see and resume the game that is to unpause it. So a couple more videos to see this all come together. Before we get on to the day's activities here. Let's left click and drag around this function or not this function this bit of script that we created in BP skill, double jump in the last video, I'm just going to left click and drag around it. Tap the C key and I'm going to call this so what should we call this?
Let's call this Player acquires double jump. Okay, that's pretty good. Compile and Save. Okay, so in this video, we're going to be doing some work inside of our Player Controller RPC Metroidvania. Before we do, I need to jump back out to the main level editor, we need to go back into our settings, our project settings. Find the input section over on the left hand side, and we created an action mapping for interact few videos back in this one, we're going to create a another new action mapping not in access mapping in action mapping, click this plus button.
We're going to call this action mapping exit skill. Acquire and I'm going to map this to I'm going to map this to the Right, keyboard button, right keyboard arrow essentially. And I'm also going to map this to Game Pad face button, right? Now you may notice these are the exact same buttons that I have hooked up to our interact action mapping. You may say, why do you have them map to the same thing? Well just kind of for cleanliness sake, I wanted to create a whole separate action mapping for this.
And also, the focus of this event is going to be focused on our UI, you can actually shift focus of your inputs to the UI to the game or actually have both. Okay, so with this created, I'm going to jump on over to our PC Metroidvania. That's the player control if you don't remember where that is. It's in the Metroidvania blueprints framework folder, right? There's our PC Metroidvania Player Controller, open that guy up in, I should probably put a comment around this. Let me left click and drag, hit the C key, show acquired skill.
That's pretty good. And I'm gonna find some empty space right below this right click, and I'm gonna search for that action event that we just added called exit skill acquired. There it is. Now, one thing, very important we need to do with this event node out here is with this selected over on the right hand side. I want to check, consume input off and execute when paused on. Remember our game is going to be pause as soon as that web piece Skill acquired is presented on screen.
And in order to turn it off, I want to be able to fire out of this event this event is only going to fire. If I say yes, it can execute one pause. The reason I unchecked this consume input is because with a checked, this would work only once. by unchecking it it will be able to fire off again. So with that, I'm going to drag a wire off of our press event here, bring in a branch. In the condition that I want to evaluate is I'm going to right click and search for his game.
Pause and we're going to plug that into our branch that's going to evaluate if our game is paused or not. If it is pause, we're going to drag in our w BP learned skill here. Drag off of this and typing Remove from Parent. Now remember, this variable starts out empty. But as soon as we interact with our BP skill double jump, we interact with it here. We create this w BP skill acquired widget inside of our double jump.
And then we're taking the return value of that and populating our w BP learned skill inside of our Metroidvania here so it's no longer an empty variable. Okay, so jumping back to our PC Metro avena this is where we're going to say that we are going to remove this from the screen. Okay, after we're done removing that from the screen, I'm going to drag out I'm gonna do a search for set game set Game paused, there's the function node for this. And we want this to remain unchecked, we do not want the game to be paused. Then I'm gonna right click, type in Get Player Controller. And then I'm going to drag out of this and say set input mode input mode, game only.
Now these are three unique options that you have. They're all kind of in the same category, you can see the tooltip. as I hover over it says, set up an input mode that only allows player input to our player. Only player input player controllers is bonds to respond to user input. Basically, only the game is going to accept our inputs. Whereas something like set input mode UI only only a UI widget will accept users input.
So here I want to say, hey, only the game can accept input. By that, that's going to essentially ensure that over in our project settings if we press the right key or the GamePad button rights, that only the interact can happen, not the exit skill acquired. Okay, after we're done doing this, we're going to drag out of our Get Player Controller one more time and say show a mouse cursor. We're going to set show mouse cursor and we're going to leave that unchecked to ensure that the mouse cursor does not show up anymore. Okay, so with this, gonna drag out a marquee selection. Well, let me frame this up on screen so you can see what script we have just built.
When we press either the rights key or the B button, basically whatever you set up to interact ORS to fire off This exit skill acquired, we're going to see is the game paused and if it is, we're going to remove our Widget Blueprint, we're going to unpause the game and we're going to ensure that only the game accepts our inputs. We're also going to make sure that the mouse cursor is not showing as well go left click and drag around this type of sikhi call this hide acquired skill. Widget Blueprints. Okay, we're still not gonna see our skill acquired Widget Blueprint appear on screen, but what should happen is if I hit play here, gonna overlap this volume. I'm gonna hit my interact button. Game pauses and now I should be able to press that same button again.
And unpause is like so. Okay. So again, I press This button associated with this event right here in our project settings in this case for me it's the right key or the GamePad face button right to exit our skill acquired menu and continue on with the game. Okay guys, that is going to do it all for this video. One more important missing piece here that we still have to address. And that is going to be ensuring that our Widget Blueprints skill acquired actually appears on screen when we interact with that skill.
Dyess. Guys that'll do it all for this one. See you in the next one.