Path: blob/master/doc/classes/AnimationNodeStateMachinePlayback.xml
10277 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="AnimationNodeStateMachinePlayback" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">2<brief_description>3Provides playback control for an [AnimationNodeStateMachine].4</brief_description>5<description>6Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code].7[codeblocks]8[gdscript]9var state_machine = $AnimationTree.get("parameters/playback")10state_machine.travel("some_state")11[/gdscript]12[csharp]13var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback").As<AnimationNodeStateMachinePlayback>();14stateMachine.Travel("some_state");15[/csharp]16[/codeblocks]17</description>18<tutorials>19<link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link>20</tutorials>21<methods>22<method name="get_current_length" qualifiers="const">23<return type="float" />24<description>25Returns the current state length.26[b]Note:[/b] It is possible that any [AnimationRootNode] can be nodes as well as animations. This means that there can be multiple animations within a single state. Which animation length has priority depends on the nodes connected inside it. Also, if a transition does not reset, the remaining length at that point will be returned.27</description>28</method>29<method name="get_current_node" qualifiers="const">30<return type="StringName" />31<description>32Returns the currently playing animation state.33[b]Note:[/b] When using a cross-fade, the current state changes to the next state immediately after the cross-fade begins.34</description>35</method>36<method name="get_current_play_position" qualifiers="const">37<return type="float" />38<description>39Returns the playback position within the current animation state.40</description>41</method>42<method name="get_fading_from_node" qualifiers="const">43<return type="StringName" />44<description>45Returns the starting state of currently fading animation.46</description>47</method>48<method name="get_travel_path" qualifiers="const">49<return type="StringName[]" />50<description>51Returns the current travel path as computed internally by the A* algorithm.52</description>53</method>54<method name="is_playing" qualifiers="const">55<return type="bool" />56<description>57Returns [code]true[/code] if an animation is playing.58</description>59</method>60<method name="next">61<return type="void" />62<description>63If there is a next path by travel or auto advance, immediately transitions from the current state to the next state.64</description>65</method>66<method name="start">67<return type="void" />68<param index="0" name="node" type="StringName" />69<param index="1" name="reset" type="bool" default="true" />70<description>71Starts playing the given animation.72If [param reset] is [code]true[/code], the animation is played from the beginning.73</description>74</method>75<method name="stop">76<return type="void" />77<description>78Stops the currently playing animation.79</description>80</method>81<method name="travel">82<return type="void" />83<param index="0" name="to_node" type="StringName" />84<param index="1" name="reset_on_teleport" type="bool" default="true" />85<description>86Transitions from the current state to another one, following the shortest path.87If the path does not connect from the current state, the animation will play after the state teleports.88If [param reset_on_teleport] is [code]true[/code], the animation is played from the beginning when the travel cause a teleportation.89</description>90</method>91</methods>92<members>93<member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="true" />94</members>95<signals>96<signal name="state_finished">97<param index="0" name="state" type="StringName" />98<description>99Emitted when the [param state] finishes playback. If [param state] is a state machine set to grouped mode, its signals are passed through with its name prefixed.100If there is a crossfade, this will be fired when the influence of the [method get_fading_from_node] animation is no longer present.101</description>102</signal>103<signal name="state_started">104<param index="0" name="state" type="StringName" />105<description>106Emitted when the [param state] starts playback. If [param state] is a state machine set to grouped mode, its signals are passed through with its name prefixed.107</description>108</signal>109</signals>110</class>111112113