Godot Version
4.7-dev4
Question
I want to gain access to an AnimationNodeStateMachine inside my AnimationTree, I want to use the function get_node_list()however I have no idea how to access it! I know how to get to the AnimationNodeStateMachinePlayback that is housed in this, but I want the container! Is this even possible? If not, why does it have all these unusable functions?
The code example on the documentation page does not explain this, it explains how to get access to the AnimationNodeStateMachinePlayback instead… 
What problem are you trying to solve with access to the states?
I want to gather all the states in the state machine to keep a dictionary of the options available so I can travel to them with that list.
Not quite sure the reason, usually you want to set up transitions inside of the state machine itself, not in code.
However, if you really need to get the AnimationNodeStateMachine itself, probably the easier way to access it is by it’s resource path, which you can get by clicking on the node in the AnimationTree itself.
The reason is essentially less setup, but I guess that it doesn’t really matter in the end, I can do it the other way around. I’m using a state machine for a characters’ expressions and wanted to just add a new expression to the state machine and it ‘automatically’ making it an option as a ‘state’ inside the dictionary
It’s not necessarily wrong, you can do it the way you want, but it seems far more complicated this way.
But as I said, you can get the state machine by it’s resource path if you want to go that way.
I have figured it out! anim_tree.tree_root.get_node(‘NAME_OF_STATE_MACHINE’).get_node_list()
1 Like