Welcome back everyone in this video I want to take some time out to get our interact message showing whenever our player overlaps a trigger volume in one of our diocese. Now, before we get started with this script, I want to direct you to your BP skill base. It's in this directory right here content, Metroidvania blueprints, actors, open up your BP skill base, because what I want to make bigger for this interaction is this trigger volume right here. I have made this adjustment between videos so I'm going to show you exactly what I did. So inside of our BP skill base, select your interact collider over in the components panel. And let me just jump back to a perspective view here.
With your interact collider selected. I went ahead and I changed the location have our interact collider to be x zero y, 270 and Z of 95. And then I changed the box extents to be x 100, y 300 and z 100. So we've got a volume like this out here. And you can see how that translates once we place it in the level. The idea here is that our character is going to be able to overlap this trigger volume.
And when they do we want this sort of a notification or w BP notify to appear directing the player on what button they need to press to interact with that skill Dyess to claim the skill. All right, so with that all in place. The next area I'm going to direct you to is our BP skill double jump. Let's open up this guy. No to that, once a you do. make those changes to the size of your trigger volume in your BP skill base.
Like we did As soon as you Compile and Save that, because our BP skill double jump inherits from the BP skill base, the trigger volume inside of our BP skill double jump will be modified as well. Okay, so just to avoid any confusion I'm going to close out of my BP skill base, open up my BP skill double jump. And inside of here I want to create some script to show that interact message. What I'm going to do is I've got an actor Event Begin overlap Event Tick, I'm going to delete these two out but do not delete out this Event Begin Play and this parent Begin Play okay. We want to leave that. So what we want to do is select our interact collider up in the components panel, and we can right click on this we're going to add an event and we want to add an on component begin overlap event.
Okay then off of this we're going to drag out of the other actor. We're going to cast to our BP player to make sure that it is our BP player overlapping out and then inside of our BP player we just created a variable called can interact. Get can interact. And if you don't recall, here's our my BP player we created this variable for 10 interact. Okay, jumping back to my BP skill double jump. Sorry, I didn't want to get can interact I wanted to set can interact.
We want to make it so that if he is overlapping, that trigger volume we can interact with it. So make sure that that is checked right there. Okay, the next thing I want to do is drag a wire out of Set node here and I want to bring any branch node. And obviously, I need to evaluate some condition. So what is the condition that I want to evaluate? Well, the condition that I want to evaluate is, Does our player already have the double jump skill.
And now I can get a reference to our player straight from our cast to BP player, but also, I can get a reference to our player by coming into my blueprints panel right over here, there's this little drop down, click right here. And if you don't have shown in various inherited variables checked on, you want to make sure that that is checked on because inside of our show inherited variables, we have inherited our interactive object variables, one of them being the reference to a player. So go ahead and drag out a reference to your player that will give us a reference to him. Then drag out of our player and let's see Typing has double jump. This is a boolean variable that exists inside of our BP player. So that is a condition that we are going to be checking against.
Okay, and if this condition evaluates to false, then I want to bring in another branch. And the other thing that I want to check is dragging out of our player once again, type in is using mist we're going to get is using mist. This is working a little bit ahead, but through some testing, we do need to check if our player is using the miscibility because we do not want to do anything if our character isn't misformed. Basically, we don't want our character to be presented the message that they can't interact with With this Dyess, if they are floating around in Miss form, we want them in human form. Okay, so if that is false, we're then going to bring in a where am I looking? Next I want to bring in our interact message variable right here.
Drag and drop that in. We're gonna get that. And something else I need to bring in is our w BP notifier. Drag that guy in. We're going to get that and inside of our w BPH notifier. I want to drag out a wire and type in set received message.
Click the sorry if this is false, make sure you've got this. If this is It's false. We want to set our receive message. And the message that we want to pipe in here is going to be learned skill. Like so. And if you remember, right, these variables right here were created on our BP interactive object.
We're talking this guy way back when. So we created our w BP notify widget. That's this guy right here. We're creating that inside of our BP interactive object base, and then we're setting that to a variable. And remember all of our skill Dyess is inherit from this so that's why we're able to access this variable from our BP skill double jump. Okay, so that's going to set the message here inside of our web notify here to show not interact message, but instead it will show The text learned skill.
Okay, flip in my page and notes. Next thing I want to do, I'm going to drag off of my w BP notifier here and type in Add to Viewport. And another thing I want to do is I want to drag off of our web notifier. And I want to play in animation and the animation that I would like to play. I can also drag out of my w BP notifier. And it is the intro animation.
If you just type in intro right there, you can get that and plug that into the in animation. So the idea here is in our w BP notify, if you remember we created an animation called intro and so we're To tell that to play flare out, just like that. So we're calling all this to happen. We're telling all this to happen inside of our BP skilled double jump. Okay, next thing I want to do is I want to bring in a reference to our s FX can interact. This is an inherited variable as well, we're going to get that.
And then I'm going to drag off of here, and type in play sound to D. And I'm gonna click this little drop down here. I want to set the volume multiplier for this to be five because it's kind of a quiet sound. And if you remember, right, we already determined what this sound effect was going to be. It's this floating UI close, and we set this all the way back in our BP interactive object. We back in the day right They're right there. Okay, so with all that script done inside of our BP skill, double jump, I am going to left click and drag out a marquee selection, hit the C key.
And I'm going to call this show should make this appear on screen here show. Interact, message. Let me try to fit this whole script on screen. So if you want to pause the video, you can see what we have built here. Take careful pans to ensure that you've got this can interact set to true. And another key thing in order to make this script all come together is you got to make sure that your interact object variables over here are showing so that you can reference them.
And again, the way I got that was to click right here show inherited variables. Okay, so with that, I'm going to Compile and Save right away. And I can actually jump in and play right now to see this appear on screen. So right now my player is not overlapping that trigger volume but as soon as I moved to the right, there we go, the message appears saying learn skill. However, if I leave that trigger volume, it still appears on screen and you see that every time I overlap it it is going to show again and again and again. Like so.
And once I escape out of here, I'm gonna get some error messages. Don't worry about those for the time being, this is still a work in progress. Okay, so that is how we make the interact message show. We need to be able to hide it as well. So the way I'm going to do this is I'm going to come under our interact Collider. I am going to right click on that components we will add an event for end overlap.
In here, two out of the other actor We're going to cast to our BP player to make sure that that's the one that ended the overlap. Then I'm going to bring in a reference to our w BP notifier. We're going to get that. Then I'm going to drag out of this. I'm going to type in play animation. Like so, I'm going to drag out of the W BP notifier.
And I'm going to do a search for intro get our intro animation. plug this into the in animation. However, here the play mode for this animation is I don't want to play it forward. I want to play it in reverse. So make sure you make that adjustment. Okay.
And then what I want to do is I want to drag off of our play animation. I want to bring in a delay node, not a retrievable delay, just delay. And I want to drag off of my intro animation here. And what I can find if I drag off of that is a node called get end time. And it outputs a float variable. So that is going to be the duration of our delay.
So that's going to sync this up really nicely. So once we get the end time of that animation, we're going to drag off of delay. Actually, we're not going to drag off a delay just yet. I'm gonna bring in another reference to our w b p notifier. here and the reason I'm gonna get a reference is because I need to drag a wire out of this and type in remove from parents that node right there. So after this delay is done I am telling This w BP notify to be removed from the screen.
That's what this Remove from Parent node does. Then last but not least, I want to bring in another reference to my player here. Get them, drag a wire off of your player. and type in can interact, we're going to set can interact like so. Only this time we're going to leave this unchecked. The idea being that we're going to tell our player that once they're not overlapping that trigger volume anymore, they're not going to be able to interact with that Dyess set out that or that line trace that we scripted in the last video.
Yeah, you can't do it. You need to be interacting, you need to be within this trigger volume and have the message up first before you can interact with it. Okay, so with that meta script, I'm going to left click and drag around all these nodes, type that C key, tap that C key, not type That's the key. And I'm going to call this our hide, interact. Message script. Okay, let me bring this on the screen so you can see this in case you want to pause the video right here.
Make sure that you're reversing that play mode right there that you have this set to false. Let's Compile and Save this and play and see if this is all working properly. Okay, so our player overlaps. And you see the the message there, float away. There, it comes on there floats away, and if I do shift an f1 right here, I can kind of minimize our window here and you can actually see this script in the background. firing off is I am currently ending my overlap.
So watch carefully. And then when I in my overlap, watch the script above. You can see it all fire appropriately. overlap and overlap. Sweet guys that will do it all for this video. more to be done yet but we'll see you in the next one.