seek in Animation Tree

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kongminh113

Hi guys,
What is the correct way of calling seek() in AnimationTree ?
func loop_function():
if Input.is_action_pressed(“ui_x”):
is_chidori_looping = true
$AnimationPlayer.play(“walk”)
$AnimationPlayer.seek(0.5,true)

I called this function inside of AnimationPlayer but it is not working. It seem to generate more animationplayers inside. Could it be there are no relationship between AnimationTree and AnimationPlayer when playing ?

I want to charge when holding button and change to another animation when release it. During the charge the animation will loop from x position time.

:bust_in_silhouette: Reply From: Becbunzen

Maybe easier to do separate animations within the same AnimatedSprite, and switch between them using _process() every frame as needed?