Animation Tree freaking out for.. 1 frame.

Godot Version

Godot 4.4.stable

Question

Currently using an AnimationTree to make a lot of the thinking for the character’s animation state, and I have come across a weird artifact from it.

Godot_v4.4-stable_win64_NLTlTTQyAx

The character has a feature to lock their aim to a specific direction while being able to freely move, though whenever you move from one direction to another, there is a single frame where it shows the player aiming directly up, which is very intrusive as a visual bug whenever you move back and forth a bunch.

It likely has to do with the transitions in the AnimationStateMachine, but nothing I did really seemed to help. I was wondering if anyone has any clue as to how to fix this.

1 Like

We’d probably need to see the state machine to comment on it; there are lots of possibilities.

One thing you might want to check is if any of the actual animations have a stray frame in them; it does happen sometimes.

1 Like

The AnimationTree’s StateMachine currently looks like so:

The sprites for shooting while walking backwards and forwards are both in the walk_shoot node.

(replying again since i can only attach 1 image per reply as a new user… apparently.)

There are no stray frames in any of the up animations.

For a matter of fact, I also tried this with the animations aiming downward and the same issue happens.

Seems like this happens for any BlendSpace2D that goes from one side to another - despite it being set to ‘Discrete’, it interpolates through the middle one for one frame. Is there any way to prevent this…?