Download

Directional Jumping (Blendspace & Anim BP)

I’m not sure why I’m just now getting around to saying hello on the forums, but - Hello!

This is my first post on the Unreal Forums! Professionally I’m a Lighting Artist but in my spare time I’ve been developing my own game. I’m currently struggling with something in isolation and I figured it was time to ask for some help!

I have a character that floats above the ground and leans into directions for movement. I’d like to get the character jumping and continuing that direction and momentum. For prototyping gameplay, it has always been acceptable for the “Idle” jump to play, but now that things are moving along, I’d like to make this feel more fluid and elegant.

I created a Jump Blendspace using the same parameters as the Movement blend where X Axis is ‘Direction’ (-180 to 180) and Y Axis is ‘Speed’ (Idle to max speed)

Here’s how the Speed & Direction floats are set up in the Anim BP I’m working with (which I feel is pretty standard):

https://files.slack.com/files-pri/T2E5Z6879-FCH8N4N7P/screen_shot_2018-08-28_at_11.11.38_pm.png

When the blends replace the single animations in the state machines they don’t work very well. I think the ‘Direction’ parameter might be working as I seem to get the Forward, Left, Right Animations but the ‘Speed’ parameter seems to be the issue.

I’d like to jump in place when I’m Idle/0 speed, and then use my Directional jumping animations when I’m moving in those directions. I’m starting to wonder if I need a 1D Jump Blendspace for direction and some kind of parameter that helps calculate acceleration/speed that will play the “in place” animation if the player is at 0 or will play the Blendspace if the player is above 0.

I feel like I’m SO close but just missing a small detail. Any help or insight would be amazing including light pats on the back, hand holding, and images because I’m pretty bad with this stuff!

Good morning everyone! I’ve got an update on this!

I’ve updated the Event Graph in the Anim BP to get a “Is Moving” boolean. Here’s how that was accomplished, pretty simple:

Screen-Shot-20180905-at-11.12.08-PM.png

This is Identical to what I showed in the previous post but now I have a branch that sets “Is Moving” when ‘Speed’ is above 0.

Now in the Jump state machines, I’m trying something a little different:

Screen-Shot-20180905-at-11.16.55-PM.png

My thought with the setup above is that the character would play the full single animation if jumping in place/not moving. If you are moving, we will instead play the Blendspace that uses direction to drive the animations.

The above seems to work WHEN MOVING but when I’m standing in place I’m getting some strange results:

  1. Getting poses from the Jump Blendspace and not the “Jump In Place”.
  2. These poses from the Jump Blendspace play differently based on what direction the player is facing (Example - Jump Right @ world rotation 0, Jump Backward @ world rotation 90, etc)

This is a link to a gif of what’s happening on standing still (hope this works):

https://media.giphy.com/media/WytLM79z44VzUCQ5n3/giphy.gif

Bumping for glory!

This is a guess, since you didn’t post the full anim blueprint, but it might be that speed becomes > 0 the moment you start to jump, which leads to the blendspace being played. How do you determine speed? If you do something like GetVelocity: Jumping up is movement too, thus velocity will be greater than 0 and IsMoving becomes true even if you start your jump from idle.

It might be tedious, but I suggest you show us the complete animation blueprint.

Hey ramesjandi, thanks for the reply!

Here’s my Anim BP Event Graph:

I think you’re totally right here - it’s possible that the idle/in-place jump doesn’t understand that I’m not moving fully and it plays that Jump Blendspace instead but with some funky directions because I’m not entering an input (as seen in this gif: https://media.giphy.com/media/WytLM7…Q5n3/giphy.gif )

I’m not sure how best to really go about this :frowning:

I’d like to jump in place when standing still, and then jump with directionality (Forward, Right, Back, Left) when I have move the Left Thumbstick input in those directions.

Any help you or anyone could lend here would be incredible <3

I’ll have a thorough look later today, but wanted to write quickly that I think the “funky directions” part isn’t really that funky. It seems to me the direction is always the same in world space, i.e. to the left of where you started in the gif above. At the beginning, your character leans to the left. After you rotated about 90 degrees to the right, it now leans back, so still to the left of the starting direction. The same after rotating another 90 degrees, this time to the right of the character. I think this is really only the default direction (maybe positive X?) in world space, so I wouldn’t worry too much about it for now.

Thanks again for your reply, ramesjandi!

Your prior guess was dead on! This morning I got velocity and used a print string and on jump, I go from 0 to around 500:

So…No wonder this doesn’t work!

Now this begs the question - How do I get my Anim BP (or Character BP?) to understand that I’m standing still/idle to play my “Jump in Place” animation and to play my Jumping Blendspace when I’m moving?

Doing some detective work!!

I THINK I GOT IT!!

After the print string, I might have gotten wise! I split the velocity struct and noticed that I only wanted to “Jump from Idle” when the X & Y axis was at a 0. Jumping was adding movement to the Z axis as shown in my image before.

So, rather than an ‘Is Moving’, I got Velocity and am checking if X & Y = 0, if so Play the “Jump in Place/Idle” and if not, play the Jump Blendspace.

Screen-Shot-20180908-at-11.59.25-AM.png

Now we’re cooking! Thank you SOOOOO much, ramesjandi for your insight and help so far on this!

Next is figuring out how to make my transition rule work with BOTH of these animations because at prototype, the only rule was when the Jump Idle animation was finishing at a ratio of a decimal point. With the addition of the Blendspace, I’ll be curious to see how that will work.

I will update this with my success or failure with my transition rule update. I’m unsure how exactly to approach it so I’m sure there will be some more questions.

Well, the transition rule was just as simple as it was before, just needed to add an ‘Or’:

Screen-Shot-20180908-at-12.34.53-PM.png

Here’s a video:

https://media.giphy.com/media/OqJ5Eb58rkiabFbrxR/giphy.gif

This whole thing has only been about my “Jump Start” so I have work to do to get the Jump Loops and landings to do the same thing but hopefully I’m armed with the knowledge to do the exact same thing with those parts to complete the more fleshed out package!

Will update this on completion.

It’s not perfect but we’re getting somewhere.

Showing the old jump vs. the jump updates. Now, you’re movement is carried through jumps!