I am trying to return the current playing animation from my AnimationTree but have not been able to figure out a way to make that happen. I thought I would be able to use current_animation on the AnimationPlayer but that attempt fails because the AnimationTree doesn't seem to change the current_animation property of the AnimationPlayer when it switches between animation nodes.

This line always returns true:
print($AnimationPlayer.current_animation == "")

This line always returns false:
print($AnimationPlayer.current_animation == "idle")

Since current_animation isn't a property of AnimationTree I can't use it on the tree itself. I've also tried active and is_playing but they don't account for a specific AnimationTree node that is playing. I've attempted a few other things also but no luck.

Any work around or help on how I can get the current playing animation node from the AnimationTree would be great. Thanks.

Megalomaniak Thanks but that didn't give me what I needed. I did get something out of it though.

I did however find an answer. Using AnimationNodeStateMachinePlayback API. It has a get_current_node() method that returned the current running animation. That allowed me to do if state_machine.get_current_node() != "attack":

[https://docs.godotengine.org/en/stable/classes/class_animationnodestatemachineplayback.html?highlight=get_Current_node#methods]