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
€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, 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.