Godot Version
Godot v4.2
Question
I am using an AnimationTree StateMachine for a 2D platformer character as a means of future-proofing for when we add lots of animations and handling the logic for that. Right now it consists of two sub StateMachines for handling grounded and mid-air animations. I would like for the ability to check in-code for the current node, but my current method is returning the name of the subtrees and I don’t know how to go a level deeper.
This is what the OnGround tree looks like. I would like for the ability to check for when the tree is currently in the “turn” node. Using $AnimationTree.get(“parameters/playback”).get_current_node() returns “OnGround”, the name of the subtree.
First time posting so if more information would help let me know