Download

2D side scroller - land animations

I want to create a system where there’s specific:
jump animation,
Falling animation,
Landing animation,
Running animation.
But I haven’t found a way to keep them from overlapping. For instance, when I land on the ground my character makes a landing animation for a split millisecond and then goes back to his idle animation.

I’m a beginner so IDK what I’m doing.

It sounds like you need to tweak ( or make ) the state machine in the animation blueprint.

That decides what animation will play when ( mostly ), and using a state variable, you can decide when to move the player from one state to another, and consequently, which animation to play when.

Inside the little double arrow are pieces of code, letting the system know when to move from one state to another.

1 Like

This seems like a good thread as any to piggyback off of for a similar problem I’m having with my own animation graph.

Sorry for how messy it is, but anyways, much like the poster I’m having an issue where if my player character lands on the ground when they’re in the middle of their melee attack animation, the character will enter into their falling or landing animation (I’m not sure which one) for a brief second before returning to their idle position. Ideally, the character should instead directly transition from their melee attack animation to their idle position if they land before the attack animation is finished.

Too elaborate upon this, how everything currently works with how the various animations at play flow from one another is that [Melee: Fall → Fall Loop] via the ‘IsAttacking boolean == false’ transition and then [Fall Loop → Landing] via the ‘IsJumping NOR IsFalling boolean variable == false’ transition before finally transitioning back into the idle/walking/running pose.

The problem I’m having is that I can’t figure how out to create a transition that would allow the Melee: Fall animation to go directly to the Idle/Walk/Run animation if the player is touching the ground. I tried the setting the transition as ‘IsJumping NOR IsFalling boolean variable == false’ but that didn’t work. I think I need both the ‘IsAttacking boolean == false’ and ‘IsJumping NOR IsFalling boolean variable == false’ to get it to work properly but I don’t know how to set it up properly. I’m also not sure whether or not that it would work even if I could get it set up correctly, as I’m just making an educated guess based on my limited knowledge.

Hungry, it will be transitioning because you have told it to, somewhere…

Bear in mind, there are other places to control character animation from. Before you get as far as the state machine, you also have blend spaces ( for instance ) which change animation based on character speed / orientation.

Also look in the event graph part of the anim BP, what’s in there?

There’s a lot of stuff in the event graph portion of my character’s animation blueprint, too much to fit into a single screenshot although most of isn’t relevant to the issue I’m having.

However, I should probably include the portion of the blueprint that includes the ‘IsAttacking’ boolean variable, since its used for transitions to and away from the melee attack animations.

is_attacking

As for blend spaces, I’m using one for my character’s walking & running movement but that’s it.

I need some way to transition from Melee: Fall to Idle/Walk/Run, bypassing Fall Loop, & Landing but I can’t seem to get it working.

I tried this using this transition rule since it worked for transitioning from the Fall Loop to the Landing animation but it doesn’t work for transitioning from Melee: Fall to Idle/Walk/Run.

melee_ground_transition

Is it because you need a unique set of conditions to navigate this area?

image

I imagine there’s a lot of transitions checking those bools, so it would be easy for the system to not be sure which route to take.

Instead of bools, why not just use a state variable? A text variable. As your character adopts different behaviours, it can set the variable accordingly ( flying attack, simple jump, falling, etc… )

That way, there’s only one way from one state to another ( unless you want more than one ).

I don’t know, my best guess is that I need a transition rule that’s essentially Is “Attacking = False / Is Jumping = False / Is Falling = False” but the NOR node only allows for two booleans and not three like I need.

Instead of bools, why not just use a state variable? A text variable. As your character adopts different behaviours, it can set the variable accordingly ( flying attack, simple jump, falling, etc… )

That way, there’s only one way from one state to another ( unless you want more than one ).

I don’t know what a state variable is, I tried doing a Google search but I couldn’t come up with anything relevant.

You can do a 3 way NOR

Like I say, the state variable, is just a text variable. But it gives you a lot more scope.

I have some bird AI, and I use states like ‘pecking’, ‘take off’, ‘flying’, ‘landing’ etc. See what I mean? More control…

1 Like

Thanks for the response, unfortunately though, its still not working properly. My character upon landing on the ground while in the middle of their mid-air attack animation will still awkwardly play the landing animation rather than ignoring it and going straight from the attack animation to their idle/walking/running animation.

If you’re confident that this problem is caused by the state machine, then a text variable is the solution.

The issue with using a bool, is that the state machine isn’t sure which part of the tree to fire. I think that’s what’s happening here.