[3.1] How can I get current frame number or played time of a animation inside a animation state machine?

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

I have a animation state machine which have several states.

Each state is a animation and I want to know the current playing frame number, or playing time of the playing state in gdscript.

How can I do that?

Thank you.

:bust_in_silhouette: Reply From: gtkampos

From the AnimationPlayer manual:

float current_animation_position - The position (in seconds) of the currently playing animation.