What should I input for ("AnimationNodeName"), thank you.

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

Thanks for answering my question, I tried but this line does not work for me yet, could you explain what should I put in as “AnimationNodeName”? I tried the name of my AnimationPlayer node, but does not work.

:bust_in_silhouette: Reply From: exuin

Your path is probably incorrect. If the Animation Player isn’t a direct child of the node the script is on, it won’t work.

Thank you for your suggestion, I find out the reason might be Animation Tree has its own tree structure, and using the node path in the scene tree is not working. After do more research on AnimationNodeAnimation class, I could find out the name of animation inside Animation Tree / BlendSpace 2D, but it is hard to find out which animation is actually playing, so in the end I end up using a workaround to add a call method track in my animations, so once it is played it update its name to a variable, that way I know which animation is currently playing. I could just use the variable for other functions.

Idleman | 2022-06-01 04:22

:bust_in_silhouette: Reply From: Inces

If You look at your animation Tree in editor it looks like a chart connected by lines. For example, my animation tree consists of 3 animation nodes, 3 time scale nodes and 1 blend node. It combines animation of head and torso with animation of legs. You can say, that 3 animations play simultanously this way. So I can’t get “current” animation being played, but I can get all 3 current animations, one for every animation node in the chart.
If your tree is simpler, You must have used at least one animation node. Just check its name in the editor - if You didn’t change it and there is only one, it will just be named AnimationNode or something :).
Also, read about AnimationTree and AnimationTreeRoot in editors help, there are all sorts of methods there.

P.S. I hate that AnimationTree doesn’t have animation finished signal, it totally cripples use of this node

Thanks for the insightful info, the AnimationTree is more completed than I first thought. It is handy in some way, very little code could achieve some great result. But the Animation Tree seems to have its own tree structure apart from the scene tree, which confuse me a bit, guess just need to learn more about it.

Idleman | 2022-06-01 11:40