Janky Animations through an AnimationTree

Godot Version

Godot Version 4.6

Question

I am having trouble figuring out why some of my animations look Janky / Glitchy.

I’m new to this so I’m sure that I’m missing something that’s very obvious. But I’m missing it none-the-less…

I’m using an AnimationTree/StateMachine/BlendSpace setup. My ‘Walk’ and ‘Idle’ animations seem to be functioning fine, but my tool animations are very ‘Janky’ or ‘Twitchy’. I’ve only shown the ‘Axe’ animation in the video but all of my tools behave the same.

I’ve attached a screen recording of as much of my set up as I thought necessary and a recording of my script. If there is more information that would help narrow in on the exact issue I would be happy to provide it.

In the second video, from 1:02 to 1:05, Can you show the red warnings from the debugger?

also, when your starting the tool ONESHOT animation, are you pressing the movement keys?, can you check if can_move: bool is set to false when you start the tool animations?

var can_move: bool = true

func _on_animation_tree_animation_started(_anim_name: StringName) → void:
can_move = false

func _on_animation_tree_animation_finished(_anim_name: StringName) → void:
can_move = true

is this what you’re after?

whoops I replied to my own message not yours :sweat_smile:

ok I’m not really sure, but from what I can see from the error, the error usually happens when you start the animation either from the left side or the right side

I’ve noticed from the second video that you are setting the hframesand vframes at the start of each axe animation, can you temporarily remove them, so that only the frame is being set?

I removed the H & V Frames… It got weirder :joy:

I’m using multiple sprite sheets in a sprite2D and if I didn’t lock in the amount of frames for each animation they would change to the most recent one loaded in. This was my solution to keeping them from changing. The walk and idle animations are set up the same way and don’t have that same problem.

oh, so thats why you were setting the texture in each of the axe animations in the second video, my bad, I didn’t see it properly.

you said that you had multiple sprite sheets, why not merge them into one, so that you dont have to set the hframes and vframes every time for each animation when you change the texture, and just manually set them in the inspector?

That’s what I did first but than realized if I wanted to add more animations later I would have to add it to the sprite sheet and than replace the sprite sheet with the updated one. I assumed I would then need to re-load all of the animations because in theory the source had changed… Maybe I’m wrong about that . It just seemed like there had to be a much simpler, straight forward way that didn’t lock me into a ‘final’ situation. I think that will be my next step though. The reality is this is just a practice project anyways. I just wanted to be able to make changes if I wanted to. Seems to be a problem of mine. I’ll let you know whether or not it fixes the problem.

Well there you have it. All the time I spent avoiding the inevitable… and it worked