Animationplayer play_section_with_markers not working as expectged. Am I missing somethign?

Godot Version

Godot 4.7

Question

So I'm working on some kinda of parrying, and while it functionally works, it's the animation I'm having trouble with.

Example, I have this animation for an attack:

When it connects with another attack, I want it to jump to the “clashed” marker, and pause there:

But, when the attack is parried, it just pauses right where it is. I tried stopping the animation first then playing from the marker, but then it just stops at time=0:

This is a parried attack looks:

See how shield bro still on the first frame

Code I’m using to start the animation:

	var current_anim:= melee_attack_helper.light_attacks[melee_attack_helper.combo_int]
	anim_player.stop()
	anim_player.play_section_with_markers(current_anim, &"clashed")
	print_debug(anim_player.current_animation_position)
	anim_player.pause()

current_anim is the name of attack animation. Let me know if I need to put more code

the print debug shows the time as “0.0”, but should be like “.6667” or somethere, where the marker is.

Thanks for the help in advance

AnimationPlayer.play*() methods update the next frame. If you need to update it immediately then you need to call AnimationMixer.advance()

From AnimationPlayer.play():

Note: The animation will be updated the next time the AnimationPlayer is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call advance(0).

Yup that was it, thanks for the assist!