Loot animation when falling

Godot Version

Godot V4.2

Question

Hello, now I have an idea to make a jumping animation system, first I want when I jump up, there will be a jumping and flying animation (already done) but when I make a falling animation then continue. Land is a problem
image

The problem is that I want the animation to loop during the falling process. Then what should I do to get what I want?

By the way I’m wanting to do it with animation tree. I tested with the following animation tree but after jumping it changes to landing

here is my jump code:

func jump():
	if jump_count < (JUMP_MAX - 1):
		animation_tree.get("parameters/playback").travel("jump")
		jump_count += 1
		velocity.y = jump_velocity
		is_jumping = true

Well, I’m making a double jump command, so when I fall from the second jump, I need to loot the falling animation

Please help me! Thank

You have to set the advance_mode property of the transition between fall and land from ‘auto’ to ‘enable’. That way the fall animation will loop, it won’t advance to land after the fall anim played once.

But since it won’t advance automatically, you have to either use the advance expression box to tell it when to advance to the land animation (when the player touched the floor).
Or you have to call travel() in the script when the player landed to travel to the land anim.



it skips the fall animation

image

When I press the landing animation, it skips the falling effect. But when I press the fall animation. It start in jump and go to fall

Well I think that’s how it’s supposed to work in the editor, it just goes to whatever you click. You have to test it in game, and keep the land condition false until the character actually lands.

Can I use animation sprite and animation tree at the same time? When I jump, I use commands:

sprite.animation = "jump"

When moving, I will use animation tree

animation_tree["path"] = true

or

animation_tree.get("path").travel("jump")

because it worked if using AnimationSprite2D