How do you make proper jump + fall + land animations in Blender Game?

Please take a look at the attached .blend file I have here so that you can see exactly where my problems come in.

Project Lab Escape Prototype x.blend (1.78 MB)

When the initial jump key is pressed and the player goes up, it stops playing the jump animation, then stops as long as you have your finger on the jump button. It does not play the falling and landing animations either. Now I tried setting up a method in which this could happen, but I eventually gave up. My game requires the fall animation to remain playing for any given length of time until the player lands on the ground. No matter what happens, even if the falling animation doesn’t play in time, the landing animation has to play one the player lands on the ground.

My method was to play the “falling” animation once you let go of the “x” key. I did this by adding a keyboard sensor, making the key “x” and then inverting it. Once this happened, it would then “change state” to state 2, where there’s an Always sensor playing the “falling” animation. This did not work, so needless to say, I have no idea on how to pull this off for the “landing” animation.

Another issue I run into with this is that the jump animation can be played continuously while in the air, even though the motion is only set to play two jumps before falling. There’s also an issue of the “jogging” animations playing while still in the air. I’m so freaking lost with these animation priorities, I have no idea how to organize those.

If there’s a way to do everything I just talked about with just logic bricks, or if there is a python method to going about this, I could be greatly appreciative, I’ve almost completely ran out of hope. I’m having the same exact problems with punch combos.

what version of blender are you using? most of the recent versions have broken animations in the bge. upbge seems to have fixed them and 2.74 bge works great for me.

I’m using 2.78c, but that doesn’t really answer the questions. Even if I was using the correct version, I still don’t know how to solve this problem. Could you please look at the file to see what I did wrong? I’m also not sure what animation bugs you’re talking about.

just cast a ray down with the length of the player/2 + offset
if ray positive your on ground, if not play fall/jump animation.

freaking lost with these animation priorities

its easy, 0 comes first, 10 comes last.
anim at prio 0 will play before anim on prio 10

So which gets connected to which? What I thought was that I’d have to put a game property on the armature and make it an integer, then put a ray sensor on it. But since I don’t understand how ray sensors work, I’m kinda just going off on a whim. Could you properly explain the step by process, as in, WHICH actuators get connected to WHICH sensors and their settings? I’m ignorant as a baby, you can’t explain something like this to me and expect me to just get it right away, this stuff is complicated to me. I’ve only gotten this far from in depth tutorials.

ray and a keyboard -> and -> action and motion
now you can jump when ray is positive.

now connect the same ray to -> Nand -> action
now when the ray is not positive your falling or jumping, this you can handle with priority

put jump on 0 and falling on 1 or higher, so jump gets executed before falling.

Please watched the following Google Video I made.

In this video, I show what my problems are. Keep in mind that I’m pretty new to all this, so I don’t quite understand everything. Also, if you need to download it, you’ll have to watch it in the VLC player, it doesn’t wanna work in Windows.

I already have the jump motion the way I want it, I’m trying to execute the animations to play in the right sequence.

that is what the numbers are (animation frames :D)

jump(rising)

jump(falling)

Jump(landing)

reset

@BlusPrintRandom Okay then, could you please explain that, and how it relates to animating?

Your logic design in your demo file is focused on keyboard input. Your request does not deal (or not just) deal with keyboard events.

Lets stick this together:

jumping -> jump key gets press till released (or maybe till the jumping animation ends?)
falling -> as long as the character is in air
landing -> touching the ground

You can see these as three different states. Isolates the complex process to smaller isolated tasks. Lets add the state outside of falling -> standing which is the initial state.

From standing to jumping is done by jump key as you already do it. [keyboard sensor]

I suggest to play the jump animation till the end rather rely on the user input. You might want to implement something like “channeling” to perform dynamic jump strength. Event then after the jump force was applied … jumping is done and continues with falling. You can measure the end of the animation via [Actuator sensor]

Falling means the character is already in the air. If you want you can let the character perform any artistic motions - it is still falling. (Unless you want to implement a game element “jump in air” as some games do - which requires another state). Falling ends with touching the ground (or nearly touching the ground) [collision sensor]. This event transits to landing state. Any falling animation should end now.

Landing is typically just playing he landing animation. So it ends when the animation ends. Typically the character will stand around after that.

use the property the script is manipulating, to drive a property based animation, using a action actuator, or python playAction()

0-30 rising
30-60 falling
60-90 landing

this looks at local linear velocity.z to switch from rising to falling