AnimationNodeStateMachine

    State machine for control of animations.

    Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the object from the AnimationTree node to control it programmatically.

    Example:

    • void add_node ( String name, node, Vector2 position=Vector2( 0, 0 ) )

    Adds a new node to the graph. The is used for display in the editor.


    • void add_transition ( from, String to, transition )

    Adds a transition between the given nodes.


    • String get_end_node ( ) const

    Returns the graph’s end node.


    Returns the draw offset of the graph. Used for display in the editor.


    • get_node ( String name ) const

    Returns the animation node with the given name.



    • get_node_position ( String name ) const

    Returns the given node’s coordinates. Used for display in the editor.


    • get_start_node ( ) const

    Returns the graph’s end node.


    Returns the given transition.


    • int get_transition_count ( ) const

    Returns the number of connections in the graph.


    • get_transition_from ( int idx ) const

    Returns the given transition’s start node.


    • get_transition_to ( int idx ) const

    Returns the given transition’s end node.


    Returns if the graph contains the given node.


    • has_transition ( String from, to ) const

    Returns if there is a transition between the given nodes.


    • void remove_node ( String name )

    • void remove_transition ( from, String to )

    Deletes the transition between the two specified nodes.


    • void remove_transition_by_index ( idx )

    Deletes the given transition by index.


    • void rename_node ( String name, new_name )

    Renames the given node.


    • void replace_node ( String name, node )

    Replaces the node and keeps its transitions unchanged.


    • void set_end_node ( String name )

    Sets the given node as the graph end point.


    • void set_graph_offset ( offset )

    Sets the draw offset of the graph. Used for display in the editor.


    Sets the node’s coordinates. Used for display in the editor.


    • void set_start_node ( String name )

    Sets the given node as the graph start point.