Double Jump - Anim BP (Anim Graph)

14 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
€92.78
List Price:  €129.90
You save:  €37.11
£79.40
List Price:  £111.16
You save:  £31.76
CA$136.11
List Price:  CA$190.56
You save:  CA$54.44
A$154.13
List Price:  A$215.78
You save:  A$61.65
S$135.08
List Price:  S$189.12
You save:  S$54.03
HK$782.28
List Price:  HK$1,095.23
You save:  HK$312.94
CHF 90.61
List Price:  CHF 126.85
You save:  CHF 36.24
NOK kr1,085.23
List Price:  NOK kr1,519.37
You save:  NOK kr434.13
DKK kr692.01
List Price:  DKK kr968.84
You save:  DKK kr276.83
NZ$167.80
List Price:  NZ$234.94
You save:  NZ$67.13
د.إ367.19
List Price:  د.إ514.08
You save:  د.إ146.89
৳10,976.08
List Price:  ৳15,366.96
You save:  ৳4,390.87
₹8,339.52
List Price:  ₹11,675.66
You save:  ₹3,336.14
RM473.25
List Price:  RM662.57
You save:  RM189.32
₦141,842.81
List Price:  ₦198,585.61
You save:  ₦56,742.80
₨27,810.04
List Price:  ₨38,935.18
You save:  ₨11,125.13
฿3,647.70
List Price:  ฿5,106.92
You save:  ฿1,459.22
₺3,232.12
List Price:  ₺4,525.11
You save:  ₺1,292.98
B$499.21
List Price:  B$698.91
You save:  B$199.70
R1,908.54
List Price:  R2,672.04
You save:  R763.49
Лв180.65
List Price:  Лв252.92
You save:  Лв72.26
₩135,197.71
List Price:  ₩189,282.20
You save:  ₩54,084.49
₪368.63
List Price:  ₪516.10
You save:  ₪147.47
₱5,633.91
List Price:  ₱7,887.71
You save:  ₱2,253.79
¥15,144.47
List Price:  ¥21,202.86
You save:  ¥6,058.39
MX$1,659.40
List Price:  MX$2,323.22
You save:  MX$663.82
QR364.31
List Price:  QR510.04
You save:  QR145.73
P1,370.91
List Price:  P1,919.33
You save:  P548.42
KSh13,148.68
List Price:  KSh18,408.68
You save:  KSh5,260
E£4,729.52
List Price:  E£6,621.52
You save:  E£1,892
ብር5,680.63
List Price:  ብር7,953.11
You save:  ብር2,272.48
Kz83,612.74
List Price:  Kz117,061.18
You save:  Kz33,448.44
CLP$97,978.20
List Price:  CLP$137,173.40
You save:  CLP$39,195.20
CN¥722.95
List Price:  CN¥1,012.16
You save:  CN¥289.21
RD$5,921.50
List Price:  RD$8,290.34
You save:  RD$2,368.83
DA13,490.83
List Price:  DA18,887.70
You save:  DA5,396.87
FJ$226.12
List Price:  FJ$316.58
You save:  FJ$90.46
Q779.86
List Price:  Q1,091.83
You save:  Q311.97
GY$20,923.51
List Price:  GY$29,293.76
You save:  GY$8,370.24
ISK kr13,946.60
List Price:  ISK kr19,525.80
You save:  ISK kr5,579.20
DH1,013.19
List Price:  DH1,418.51
You save:  DH405.32
L1,763.34
List Price:  L2,468.75
You save:  L705.40
ден5,702.11
List Price:  ден7,983.18
You save:  ден2,281.07
MOP$805.89
List Price:  MOP$1,128.28
You save:  MOP$322.39
N$1,893.44
List Price:  N$2,650.90
You save:  N$757.45
C$3,681.15
List Price:  C$5,153.75
You save:  C$1,472.60
रु13,335.63
List Price:  रु18,670.42
You save:  रु5,334.78
S/370.84
List Price:  S/519.19
You save:  S/148.35
K382.72
List Price:  K535.82
You save:  K153.10
SAR375
List Price:  SAR525.01
You save:  SAR150.01
ZK2,522.76
List Price:  ZK3,531.96
You save:  ZK1,009.20
L461.43
List Price:  L646.02
You save:  L184.59
Kč2,350.75
List Price:  Kč3,291.15
You save:  Kč940.39
Ft36,729.02
List Price:  Ft51,422.10
You save:  Ft14,693.08
SEK kr1,071.30
List Price:  SEK kr1,499.86
You save:  SEK kr428.56
ARS$85,766.82
List Price:  ARS$120,076.98
You save:  ARS$34,310.16
Bs691.04
List Price:  Bs967.48
You save:  Bs276.44
COP$387,583.68
List Price:  COP$542,632.66
You save:  COP$155,048.97
₡50,832.34
List Price:  ₡71,167.31
You save:  ₡20,334.97
L2,468.78
List Price:  L3,456.40
You save:  L987.61
₲737,805.73
List Price:  ₲1,032,957.54
You save:  ₲295,151.80
$U3,781.90
List Price:  $U5,294.82
You save:  $U1,512.91
zł400.73
List Price:  zł561.05
You save:  zł160.31
Already have an account? Log In

Transcript

Welcome back, everyone. In the last video we went about passing along some variable information from our BP player over to our counters animation BP. In this video, we're going to be learning about what a state machine is and how it works, we're going to be utilizing some of that variable information that we pass along. So these state machines are going to enable our player to transition appropriately into and out of different states. In this case, we're concerned about making our character double jumps. So let's get right to it.

Last video we left off in this event graph here inside of our counters Anam BP. We're going to be concerning ourselves with this other graph known as the anim graph over here in the My Blueprint panel, before I click on that, I should specify where this asset lives in the Content Browser if you took a break between videos I am right here in content Metroidvania there is our Countess annum bps of double click on that to open it up. Okay, so we are within the Event Graph tab, I'm going to jump on over to the anim Graph tab. Now the animal graph is how in where we tell our player character what animation they should play, and we can dictate which animal is played based on rules. We specify through using a state machine, you can see that there's a node right here, and on it, it says state machine, you can double click on this node.

And this is what determines which animation our characters should play and when. So we've got an idle run state, we've got a jump start state jump loop and a jump and that's it's pretty basic state machine. Now the added state, all you would need to do is right click in this graph here and you've got an option to add a state and then you can name I could name this like crouch, for example, but I wanted to add a crutch state. And then once you have a state in here, you can double click on that state and determine which animation should play when that state is called. And you can hook up an animation to that state by simply coming down here in the lower right, you've got this Asset Browser here. These are a list of different animations.

So if I wanted to have a state called crouch, and you know my player starts a jump actually, during that state, I could do that. Obviously, that's ridiculous, but I can do it. So I want to back up here and I can back up to where we were with our state machine overview right here by clicking default. And I'm just gonna delete out this crouch state because I don't actually want that. Okay, so flipping my page and else making sure I'm on task here. Okay, between our states here you see these little, these little circular things with kind of a two way arrow on it, you can actually double click on these, these are the rules that determine how we transition from one state to another.

So for example, we have a rule that determines when we transition from an idle or run into our jumpstart, if I double click on this, our rule is is our character in the air, and we're determining if our characters in the air if I jump over to my Event Graph. Here in the Event Graph where we're constantly updating, we're trying to get our pawn owner, we're getting the movement component, we're seeing if they're falling and we're passing that along to setting is in air if they're falling, they are in the air right now, falling is is not necessarily doesn't necessarily mean that they're falling it just means that they're in the air essentially but they is how we determine whether or not they are walking and running versus if they should be getting airborne. I'm going to jump back to our default state right here. So we have rules that run from idle run to jumpstart to jumpstart to jump loop and etc.

It just kind of goes in a wheel right here. Note, however, that you can have states that run back to one another. So for example, if I wanted to have a jump loop, run back to an idle run, I could simply drag a wire by left clicking right here and dragging it over to my idle run. And once I release, it's going to create this little transition note here where I can now double click on this and bring in some rule that should determine when we can transition to that state. Now, again, I don't actually want to place one there, so I'm gonna delete that out. But that's essentially what we got going on here is we've got these different states that our character can be in each state corresponds to a different animation that should be played.

And each of these right here is a rule that determines when we should enter into that state. Okay, so let's get on to trying to hook up a double jump state. What I want to do is drag off of our jump loop right here. And you want to drag kind of towards the top end of this right about here. I'm going to left click and drag. And when I release, it's gonna say, Hey, what do you want to add, I want to add a state.

And I'm going to call this double jump, start. Okay, and I want this to be placed right up here, because I want to be able to not only transition from a jump loop to a double jump start I also want to be able to transition back from a double jumpstart to a jump loop. Now that transition rule did not pop in there, there it is. I just zoomed back in there was my transition note I didn't see it right away. So if you don't see it right away you can you your mouse wheel to scroll in and out, there's my transition role. Okay, and additionally, I am also going to want to be able to transition into a double jump straight from a jumpstart.

Now the jumpstart phase if you will, is really, really brief but technically we want to be able to double jump even if we do a really rapid double tapping of our spacebar or you know the jump button. So I'm going to drag from here our jumpstart over to double jumpstart and create a transition like so. I'm not going to worry about gonna be worried about creating a transition back from this because this happens so rapidly. Okay, so first thing I want to do here is I want to double click on my double jumpstart and I want to determine what animation do I want to play when our character double jumps? Well, that's gonna be relatively easy for me. I like the third person jumpstart.

That is this animation right there. And the cool thing about this is as you kind of mouse over it, it shows you a preview of what that animation looks like. So, here my Asset Browser, my third person jumpstart, I can left click and drag this into the graph here. And then I can simply drag off of here and plug this into the result. That's all I need to do there. That part was easy.

Now what I need to do is add some transition rules. When do I want my player to actually go in to a double jump? Well, I will start off, let's start from our jump starts to our double jump this transition rule right up here. Let's double click on this. That's gonna jump me to a new tab up here. And the rule I want to have for this is simply is double jumping.

We've got this variable right down here is double jumping that we're updating constantly. I can drag and drop that right onto my transition. So The moment we detect our character is double jumping, the moment that that is set to true inside of our BP player, that is going to be passed along to our animation blueprint here in our Event Graph right there, and that's going to be the rule that we use to determine if I'm clicking back on the default write up here, if we should transition from a jumpstart to our double jumpstart. Okay, so that transition is all taken care of the next rule that I'm going to focus on is transitioning from our jump loop to a double jump start. So right here, we're going to double click on that. And I'm going to have the same rule right here double is double jumping.

Gonna plug that right on top of there. Same rule applies for that. And I can jump back out of here by clicking default right up along the top here to jump back To where I was. Last but not least, I've got this transition from double jump start going back to my jump loop, I'm going to double click right here. This one's going to be a little bit more intricate. What I'm going to do is I'm going to right click and some empty space here.

And I can search for a node and I'm going to search for one called time Remaining Remaining. It's going to be Time remaining ratio, third person jump start. Now you had similar options there so make sure that this is the one you got time remaining ratio, third person jumpstart Now how did it know third person jumpstart because it knew that I had the third person jumpstart in my double jump state that is jumping back to my default, a double jump start right here. It knew that I had that animation slot in there. Okay, so jumping back to default. And coming back to where we were this transition rule right here, I'm gonna double click on that, that's where we were.

So I'm going to drag away out of this. And I'm going to bring in a less than symbol, we're going to do float less than float like so. And I'm going to set this to be a point five. And this you can see it needs a Boolean input for there. I'm going to take the result of this and plug it into my can enter transition. So what this means is that when the animal associated with our double jumpstart, in this case, our third person jumpstart annum, when it has less than half of its time remaining, we can transition back to our jump loop animation.

Okay, so we should have an animation associated with our double jumpstart and we've got transition rules that here here and here. I'm going to Compile and Save. And we'll do a quick play test here all right, and there should be a little weirdness that happens. jump in and play. Firstly I need to get my double jump skill so make sure that you collect your double jump skill right there. I'm interacting with it says we've learned double jump.

Okay, so now I'm gonna jump once and then when I'm when I'm airborne. I will jump again once. Okay. Well, the good news is is I was not getting the problem I was expecting to have I was expecting a little bit of hitching there in our jumping. And the reason I was expecting some of that hitching is because with some of our animation retargeting I did a lot of that manually and through imperfections you can get some hitching in If you are having problems with your double jump actually firing off, I would suggest selecting this rule right here. And if it is hitting a little bit over in the Details panel with that rule selected, you have this option for automatic rule based on sequence player state.

You can check that if you are having problems with your character kind of hitching while they double jump, just keep that in mind. If it looked like minded and it worked pretty good, then just leave it alone. But if you are having problems, select that rule right there and check this box. I'm going to leave it unchecked for the time being. Now one thing I noticed that I didn't like though, is that when I double jumps, I was not getting the desired particle effect playing at my character's feet. So I'm going to jump on over to my BP player blueprint quickly.

And here's where we modified our jump script over in our move set graph right over here. And moving right along here we got our spawning emitter at location I was using this hammer spark from the Infinity Blade effects pack. Ah, the scale I had set to 111. I artificially bump this up in my testing, let's go to five, five and five. I'm going to compile, save and let's try this all over again here. Going to collect my skill, hitting my interact button.

There we go. There's my double jump. And here we go. One jump to jump. There we go. See that little kind of explosion.

My controller is going nuts right now. There we go. But you can see that nice beefy particle effect playing in my character's feet upon double jumping. All right, not bad, so we have a double jump skill in place. That'll do it all for this video guys. We will see you in the next one.

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.