Back Dash - Script #2

16 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€95.85
List Price:  €134.19
You save:  €38.34
£79.54
List Price:  £111.35
You save:  £31.81
CA$143.73
List Price:  CA$201.23
You save:  CA$57.50
A$159.93
List Price:  A$223.91
You save:  A$63.97
S$135.54
List Price:  S$189.77
You save:  S$54.22
HK$777.83
List Price:  HK$1,089
You save:  HK$311.16
CHF 89.34
List Price:  CHF 125.09
You save:  CHF 35.74
NOK kr1,131.88
List Price:  NOK kr1,584.68
You save:  NOK kr452.80
DKK kr715.08
List Price:  DKK kr1,001.15
You save:  DKK kr286.06
NZ$176.75
List Price:  NZ$247.46
You save:  NZ$70.70
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,945.33
List Price:  ৳16,723.94
You save:  ৳4,778.61
₹8,493.77
List Price:  ₹11,891.62
You save:  ₹3,397.85
RM450.75
List Price:  RM631.07
You save:  RM180.32
₦154,938.50
List Price:  ₦216,920.10
You save:  ₦61,981.60
₨27,824.38
List Price:  ₨38,955.25
You save:  ₨11,130.86
฿3,419.79
List Price:  ฿4,787.84
You save:  ฿1,368.05
₺3,519.01
List Price:  ₺4,926.76
You save:  ₺1,407.74
B$608.53
List Price:  B$851.97
You save:  B$243.44
R1,830.80
List Price:  R2,563.19
You save:  R732.39
Лв187.32
List Price:  Лв262.25
You save:  Лв74.93
₩144,627.53
List Price:  ₩202,484.33
You save:  ₩57,856.80
₪365.39
List Price:  ₪511.57
You save:  ₪146.17
₱5,882.91
List Price:  ₱8,236.31
You save:  ₱2,353.40
¥15,643.93
List Price:  ¥21,902.13
You save:  ¥6,258.20
MX$2,007.58
List Price:  MX$2,810.70
You save:  MX$803.11
QR364.41
List Price:  QR510.19
You save:  QR145.78
P1,381.63
List Price:  P1,934.33
You save:  P552.70
KSh12,923.70
List Price:  KSh18,093.70
You save:  KSh5,170
E£5,087.81
List Price:  E£7,123.14
You save:  E£2,035.32
ብር12,764.56
List Price:  ብር17,870.89
You save:  ብር5,106.33
Kz91,790.82
List Price:  Kz128,510.82
You save:  Kz36,720
CLP$98,905.10
List Price:  CLP$138,471.10
You save:  CLP$39,566
CN¥729.56
List Price:  CN¥1,021.42
You save:  CN¥291.85
RD$6,087.13
List Price:  RD$8,522.23
You save:  RD$2,435.09
DA13,485.25
List Price:  DA18,879.89
You save:  DA5,394.64
FJ$231.62
List Price:  FJ$324.28
You save:  FJ$92.66
Q770.23
List Price:  Q1,078.35
You save:  Q308.12
GY$20,913.67
List Price:  GY$29,279.97
You save:  GY$8,366.30
ISK kr13,911.60
List Price:  ISK kr19,476.80
You save:  ISK kr5,565.20
DH1,006.07
List Price:  DH1,408.53
You save:  DH402.46
L1,836.70
List Price:  L2,571.46
You save:  L734.75
ден5,900.06
List Price:  ден8,260.33
You save:  ден2,360.26
MOP$800.26
List Price:  MOP$1,120.39
You save:  MOP$320.13
N$1,840.36
List Price:  N$2,576.58
You save:  N$736.22
C$3,678.42
List Price:  C$5,149.94
You save:  C$1,471.51
रु13,597.49
List Price:  रु19,037.04
You save:  रु5,439.54
S/372.23
List Price:  S/521.13
You save:  S/148.90
K405.36
List Price:  K567.52
You save:  K162.16
SAR375.62
List Price:  SAR525.88
You save:  SAR150.26
ZK2,766.46
List Price:  ZK3,873.15
You save:  ZK1,106.69
L477.10
List Price:  L667.96
You save:  L190.86
Kč2,408.98
List Price:  Kč3,372.68
You save:  Kč963.69
Ft39,689.03
List Price:  Ft55,566.23
You save:  Ft15,877.20
SEK kr1,103.13
List Price:  SEK kr1,544.43
You save:  SEK kr441.30
ARS$102,160.40
List Price:  ARS$143,028.65
You save:  ARS$40,868.24
Bs690.76
List Price:  Bs967.10
You save:  Bs276.33
COP$435,928.80
List Price:  COP$610,317.76
You save:  COP$174,388.96
₡50,434.81
List Price:  ₡70,610.75
You save:  ₡20,175.94
L2,537.51
List Price:  L3,552.62
You save:  L1,015.10
₲779,455.88
List Price:  ₲1,091,269.42
You save:  ₲311,813.53
$U4,474.38
List Price:  $U6,264.31
You save:  $U1,789.93
zł408.66
List Price:  zł572.14
You save:  zł163.48
Already have an account? Log In

Transcript

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.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.