First frame of Idle_left play before other idle animations in the AnimationTree

Godot Version

4.4

Question

In the Idle blendSpace2D of my AnimationTree when the animation of idle start, the first frame of every idle facing is idle_left. This problem only appears on this blendspace. Also the idle facing dirction is the only facing direction which is not programmed in a state of the state machine.

Code of Idle facing:

Here is the problem:

I do this with an AnimatedSprite2D.

Then the flip code is this:

	if direction != 0:
		chibi_animated_sprite_2d.flip_h = direction < 0

It’s in the Player script.

Granted my direction is just this:

direction = Input.get_axis(MOVE_LEFT, MOVE_RIGHT)

If you really want to use an AnimationTree you should look at Blendspaces.

1 Like

Thanks, but the left and right sides of my player are not the same and the attack animation can’t be in a AnimatedSprite2D. So I really want to use AnimationTree

1 Like

I don’t think the problem is related to the facing direction code because when I delete that part of the code the same problem appears

1 Like

I might be wrong but to me it looks like the “walking left” animation is playing for a frame, not the “idle left”. Like, somehow when you release the controls the blend of the walk anim is set to left for a frame before the animation tree travels to idle.

2 Likes

Thank you, you’re right, that’s where the problem came from. In fact, when I release the controls, for one frame, the walking animation put the animation for Vector(0, 0) and this animation was: Walk_left.
I solved this problem with that code:

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.