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
€93.84
List Price:  €131.38
You save:  €37.54
£80.95
List Price:  £113.34
You save:  £32.38
CA$137.04
List Price:  CA$191.86
You save:  CA$54.82
A$154.99
List Price:  A$216.99
You save:  A$62
S$136.27
List Price:  S$190.79
You save:  S$54.51
HK$783.50
List Price:  HK$1,096.94
You save:  HK$313.43
CHF 91.19
List Price:  CHF 127.67
You save:  CHF 36.48
NOK kr1,101.37
List Price:  NOK kr1,541.96
You save:  NOK kr440.59
DKK kr700.13
List Price:  DKK kr980.21
You save:  DKK kr280.08
NZ$169.21
List Price:  NZ$236.90
You save:  NZ$67.69
د.إ367.23
List Price:  د.إ514.14
You save:  د.إ146.90
৳10,965.37
List Price:  ৳15,351.96
You save:  ৳4,386.58
₹8,334.23
List Price:  ₹11,668.26
You save:  ₹3,334.02
RM477.95
List Price:  RM669.15
You save:  RM191.20
₦125,683.43
List Price:  ₦175,961.83
You save:  ₦50,278.40
₨27,806
List Price:  ₨38,929.52
You save:  ₨11,123.51
฿3,703.32
List Price:  ฿5,184.80
You save:  ฿1,481.48
₺3,259.92
List Price:  ₺4,564.01
You save:  ₺1,304.09
B$516.59
List Price:  B$723.25
You save:  B$206.66
R1,923.67
List Price:  R2,693.22
You save:  R769.54
Лв183.31
List Price:  Лв256.64
You save:  Лв73.33
₩137,775.97
List Price:  ₩192,891.88
You save:  ₩55,115.90
₪378.18
List Price:  ₪529.46
You save:  ₪151.28
₱5,754.62
List Price:  ₱8,056.70
You save:  ₱2,302.07
¥15,478.45
List Price:  ¥21,670.45
You save:  ¥6,192
MX$1,711.89
List Price:  MX$2,396.72
You save:  MX$684.82
QR364.36
List Price:  QR510.13
You save:  QR145.76
P1,383.88
List Price:  P1,937.49
You save:  P553.61
KSh13,448.65
List Price:  KSh18,828.65
You save:  KSh5,380
E£4,807.48
List Price:  E£6,730.67
You save:  E£1,923.18
ብር5,687.89
List Price:  ብር7,963.28
You save:  ብር2,275.38
Kz83,485.81
List Price:  Kz116,883.48
You save:  Kz33,397.66
CLP$95,253.47
List Price:  CLP$133,358.67
You save:  CLP$38,105.20
CN¥724.60
List Price:  CN¥1,014.47
You save:  CN¥289.87
RD$5,894.01
List Price:  RD$8,251.85
You save:  RD$2,357.84
DA13,445.45
List Price:  DA18,824.17
You save:  DA5,378.72
FJ$227.71
List Price:  FJ$318.80
You save:  FJ$91.09
Q777.29
List Price:  Q1,088.24
You save:  Q310.94
GY$20,903.54
List Price:  GY$29,265.80
You save:  GY$8,362.25
ISK kr14,104.58
List Price:  ISK kr19,746.98
You save:  ISK kr5,642.40
DH1,013.18
List Price:  DH1,418.50
You save:  DH405.31
L1,782.83
List Price:  L2,496.04
You save:  L713.20
ден5,776.11
List Price:  ден8,086.79
You save:  ден2,310.67
MOP$806.39
List Price:  MOP$1,128.98
You save:  MOP$322.58
N$1,907.39
List Price:  N$2,670.43
You save:  N$763.03
C$3,677.32
List Price:  C$5,148.40
You save:  C$1,471.07
रु13,326.11
List Price:  रु18,657.10
You save:  रु5,330.98
S/368.16
List Price:  S/515.44
You save:  S/147.28
K379.71
List Price:  K531.61
You save:  K151.90
SAR375.04
List Price:  SAR525.07
You save:  SAR150.03
ZK2,580.25
List Price:  ZK3,612.45
You save:  ZK1,032.20
L466.96
List Price:  L653.76
You save:  L186.80
Kč2,370.96
List Price:  Kč3,319.44
You save:  Kč948.48
Ft36,978.60
List Price:  Ft51,771.52
You save:  Ft14,792.91
SEK kr1,088.71
List Price:  SEK kr1,524.24
You save:  SEK kr435.53
ARS$87,217.91
List Price:  ARS$122,108.57
You save:  ARS$34,890.65
Bs692.87
List Price:  Bs970.05
You save:  Bs277.17
COP$390,680.46
List Price:  COP$546,968.27
You save:  COP$156,287.81
₡50,009.58
List Price:  ₡70,015.41
You save:  ₡20,005.83
L2,466.51
List Price:  L3,453.22
You save:  L986.70
₲740,348.57
List Price:  ₲1,036,517.61
You save:  ₲296,169.04
$U3,852.35
List Price:  $U5,393.45
You save:  $U1,541.09
zł405.43
List Price:  zł567.62
You save:  zł162.18
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.