How to travel to second node of animationTree in code?

Godot Version

4.2

Question

how to travel to second node of animationTree in code?
i dont want to put advance_mode = auto
i want do to manualy in code, because i want to choose which one i want to play
i know how to travel to attack like this
anim_tree.get("parameters/playback").travel( "atk" )
but i dont know how to play the second node
Example

  • if im in idle node
  • then i want to play Strike node in atk node , how should i do it?

bellow is path of my animationTree node


Set the inner state machine AnimationNodeStateMachine.state_machine_type as STATE_MACHINE_TYPE_GROUPED and connect the Start node to each node and all the nodes to the End node.

Then you can use the main state machine playback to travel to the nodes of the inner state machine.

The problem is that it may throw warnings and errors but in my testing it worked fine.

Opened an issue about the warnings and errors A Grouped AnimationNodeStateMachine throws warnings and errors but seems to work fine otherwise · Issue #88878 · godotengine/godot · GitHub

thanks it work, also get the same error

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.