Get type Animation from AnimationTree using C#

Godot Version

4.2.1

Question

How can i get the current animation of instance Animation from an AnimationTree?

I have an AnimationTree that uses an AnimationNodeStateMachine as the TreeRoot.

I want to get the Animation and add a method track to this node programatically.

AnimationPlayer

obraz

(C# is not snake styled) did you tired this?

I haven’t had that experience, but can offer advice in case you don’t find the answer. As I understand it, you want to add something to the animation via. Try doing everything manually first, then repeat the same steps through the code.

For example: You moved a node in the scene and it changed its position, so the similar action in the code would be Position = Vector2(…)

Of course this is not the answer, but you don’t necessarily have to do nothing while waiting for an answer. Most of the questions I’ve asked here I’ve solved in the end :slight_smile:

Good luck!