Welcome back. Once again everyone, we are going to continue where we left off in the last video by scripting our back dash we started in the last video, this one, we're going to be finishing it off. So let's jump right back to it. inside of our content Metroidvania blueprints characters folder, find your BB player, double click on her to open her up. And again, we were over in the move set tab, you can find it here. And if you don't have that open, along the left hand side, there's your move sets tab that you can access as well.
Now this is where we left off man we left off by asking is our player facing right and if it's true, we're going to do something and if it's false, we're going to do something. So we're going to be working off the true branch first, but before we do that, I need to create a timeline. And you'll see why here in just a little bit. We're going to right click in some empty space here and just do a search for a time line. Now we're going to add a timeline. And I'm going to call this one back dash left.
And then I'm going to double click on this special node here, you can double click on it to open it up. And I want to change the length of our timeline here from five seconds to be point two seconds is gonna be a very short timeline timeline is gonna allow us to change a value over time. In this case, we want to change a float value over time. So I'm going to add a new float track right here by clicking on this button. It's going to prompt me to give it a name and I'm going to call it movements like so. I'm going to hold down the Ctrl key and use my mouse wheel to kind of scroll on and then I'm going to right click kind of move it on over into position.
Zooming on up a little bit. I'm going to add two keys to this timeline and doesn't really matter where you add them to start. I'm just going to right click here in the white space, we're going to add a key. Now this first one is going to be set at a time of zero and a value of zero. It's going to put that yellow dot right down there, then I'm going to right click again in the graph, add another key, this one is going to be set at a time of point two. So basically the end of our timeline here and the value here is going to be one.
Now you can see it kind of shot up off the top of the graph here, you can click these arrows to zoom them into view. Or if you can't ever get something like that, you can just tap the F key, and it'll frame up both of those keys in your timeline viewer here. Okay, so with that one done, I'm going to jump back to my move said tab right here. I'm going to select this timeline that I just created. I'm going to hit Ctrl C, and I'm gonna hit Ctrl V because I'm gonna want a copy of this. So we've got a better dash left.
And I'm gonna name this one that I just copied to be back, dash, right. And I'll be making use of that one a little bit later on as well. So just letting you know how I'm positioning things here, I'm gonna move my back dash left timeline up here, back to ash, right somewhere around here. And I'm sure we'll fiddle with those positions in just a little bit. Okay, so off of our true branch if our character is facing to the right here, I'm going to drag off the true branch and I'm going to bring in another sequence node and offer then zero pain. I'm going to plug this into the play from start portion of our timeline, I always want to do a play from start, so that we guarantee that our timeline plays from the very beginning of it.
Okay, moving this over to the right a little bit. So what I want to do I want our character to slide along the ground back dashing left. So to make our character slide along the ground, I need to bring in a reference to our capsule components. So you can left click and drag right there into our graph. And then I'm going to drag off of this in type in set relative location and rotation. We want to change our character's capsule components location and rotation why the capsule component because everything else is attached to our capsule component by jump over to our our viewport here.
This is our root component. So if we move this guy, everything else is coming along for the ride. Okay, jumping back to our moves that tab over here. So as we update our timeline, we're going to want to be updating our capsule components location and rotation. In this case, we're only concerned with location for back testing left. Okay, next thing I'm going to do is bring in another reference to our capsule component drag and drop it right about down here.
And I'm going to drag off of this. And I want to get the world transform for our capsule component. Basically, I want to know, where is the location of this. Now, I could, what I can do with the world transform right here, I can right click on this return value, and I can split the struct pin. Now that'll give us locational, rotational and scale data because the transform is made up of those three. In this case, I only want the locational data now I could have gotten just the world location itself instead of the world transform.
But I'm going to be doing some copying and pasting of nodes in just a little bit. So this is going to help me save step. So what I want to do is I want to lurk between a few values. So I'm going to right click again and some empty space here and do a search for lookup. Vector lookup vector. A stands for linear interpolation.
Actually, if you highlight over it says it's going to linearly and I have a hard time saying that linearly interpolate between our a location and our B location based on an elfa input right here. So if we drag off of our timeline here, are movements and plug this into the alpha. This is going to drive our movement from point A to point B. Now again, if I highlight over this loop vector, note it says in the tooltip, that will be at 100% of location A when alpha is zero, and 100% of location B when alpha is One now if you look back in our timeline here, you can see that over the course of point two seconds, we're changing the value of this float variable from zero to one. Okay. So this timeline is updating this alpha value here from zero to one.
Okay, so what do we want to plug in as our a location? Well, we want to start off where our character is located in the world. Okay, so that's going to be our initial location. Over the course of point two seconds, I want to take our initial location, Dragon off of there, hit the plus button, and I'm going to do vector plus vector here. And I want to plug into our imports here, our input here of our vector plus vector, our back dash left amount. So that add dish is going to be our b value.
So essentially where our character currently is plus add on this amount, that's going to be our new location. Okay, so that is well in good let me just slide this over a little bit like so, because I need to make sure that our then one pins got some space as well. Okay, so that's what we just built. So if you need to pause the video here, see what we just built. That's what we got going on. Make sure this is set, relative location and rotation.
Okay, next let's build off of the event, one branch of this particular sequence node. Now this then one is going to feed into some of the visual and sound effects that we want to play. So I'm going to bring in another reference to our our capsule component. Drag that in. And I'm going to drag off of here and say get world location. And I'm going to use this here just a moment because off of our event one branch here I am going to spawn emitter at location.
Nevermind some cars horn honking in the parking lot behind me. Okay, I'm gonna plug this into the location of our spawn emitter at location because I want to spawn an emitter here. And which one do I want to spawn, I want to spawn in or back dash. Remember, we just created a particle for our back dash, right there it is. Okay, so that's the first effect that I want to do. And of course, not only do I want to spawn an emitter, I want to play a sound at location.
So I'm going to continue the flow of execution here and say play sound at location. Which location? Well Funny you should ask because we can use this exact same location here. Our capital component is close enough. It's basically the heart of where a player is located. And What sound do you want to slot in here?
Well, we just made a sound effect a sound cue earlier for BAC dash. So let's slot in our created sound cue. Now, you can click this little drop down and you can, you know, bump up the volume if you want to or set and the other settings as well, but I'm going to live with what we have here for the time being. Okay, so with that, with that done, just showing you what we've built so far. Let's just do a quick Compile and Save. Okay, now the good news is we can copy a lot of these notes from our back dash left for our back dashing, right.
In fact, what I'm going to do is I am going to come under our back dash left middle left click and drag all these nodes right here, left click and highlight all those, I don't want this back dash left. So I'm going to Ctrl Click to not select that, with all these highlighted, I'm going to do Ctrl C to copy them. Then I'm going to come down here, right off of my back dash, right, just kind of showing you geographically where it's located right there. And I'm going to Ctrl V to paste them right here. Okay, so we're going to be working down here just a moment. So off of this false branch, if our character is not basing, right, what I want to do is bring in another sequence node.
Okay, and off of the then zero pin. Well, because this is geographically closer, I'm gonna put this into our spawning the emitter and our sound. Okay? And out of the then one pin, let me just bring in a couple reroute nodes here like that. off of the then one pin, I'm going to want to do our back dashing to the right. We need to make a few modifications here, but then one we're going to play from start, make sure you've got your update plugged into the set relative location and rotation, make sure your movement is plugged into the alpha of the loop.
Now one thing that we do want to take note of here and consider is that here we want to have our rotation plugged into our new rotation. We did not do that above. But here we do want to consider that so I'm going to take our rotation of our calves component. We're going to plug this into our set relative location and rotation again We did not do that above that was intentional. Then lastly, we need to swap out our back dash left here with our back dash right. Now I could delete that and then plug this in, but just want to show you another trick you can do here is with back dash left amount selected, you can right click on it, and we can replace that variable back dash left with backlash, right?
It detects that there are other vector variables that we can swap it out with in this blueprint. So there you go. We're not quite finished yet. So let me kind of zoom on out here a little bit and show you what we've got. So geographically speaking, this is our back dash right in this section. This is our back dash left up in this section.
Here is where we are playing our emitter and our sound effect. But Lastly, what I need to link both of these into is a couple more nodes. One being a delay node, I'm going to place a delay node right about here, right click delay. I'm going to delay for about point two seconds, and then we're going to get our is back dashing. B is back dashing to drag that in. And we're going to set that and say Nope, no longer back dashing after point two seconds passes, which is the length of our timeline.
By the way, we are no longer back dashing. This variable again is going to be read into our state machine to determine which animations are playing. So what do we need to plug into here are delay well, off of both of our set relative location and rotation nodes, you need to plug that into there, after the back dash, right. And then I'm going to bring this up top and off of our back dash left up here, the set relative location and rotation that's Got to go in there is well. Okay, so moment of truth. Hopefully I didn't miss anything there there is our monster script and I'll step back and reviews in just a moment but we'll Compile and Save.
Alright, let's give this a shot and see what we have got. So we're going to jump in and play here. Let's interact with our back dash skill Dyess, it is acquired. So now I'm going to try back dashing to the left here. I did back dash now I've noticed that the particle is still going so we got a problem with the emitter will look to see what's up with that and just a little bit. Again, our characters not playing an animation at all that's not supposed to be working just yet.
And because that emitter is distracting, let's go over here and face to the left now and our character's back dashing the appropriate direction but the particles are going the wrong way as well. So let's see what's up with that.