Adds a track to the Animation.
Returns the animation name at the key identified by key_idx. The track_idx must be the index of an Animation Track.
Inserts a key with value animation at the given time (in seconds). The track_idx must be the index of an Animation Track.
Sets the key identified by key_idx to value animation. The track_idx must be the index of an Animation Track.
Returns the end offset of the key identified by key_idx. The track_idx must be the index of an Audio Track. End offset is the number of seconds cut off at the ending of the audio stream.
Returns the start offset of the key identified by key_idx. The track_idx must be the index of an Audio Track. Start offset is the number of seconds cut off at the beginning of the audio stream.
Returns the audio stream of the key identified by key_idx. The track_idx must be the index of an Audio Track.
Inserts an Audio Track key at the given time in seconds. The track_idx must be the index of an Audio Track. stream is the AudioStream resource to play. start_offset is the number of seconds cut off at the beginning of the audio stream, while end_offset is at the ending.
Sets the end offset of the key identified by key_idx to value offset. The track_idx must be the index of an Audio Track.
Sets the start offset of the key identified by key_idx to value offset. The track_idx must be the index of an Audio Track.
Sets the stream of the key identified by key_idx to value stream. The track_idx must be the index of an Audio Track.
Returns the in handle of the key identified by key_idx. The track_idx must be the index of a Bezier Track.
Returns the out handle of the key identified by key_idx. The track_idx must be the index of a Bezier Track.
Returns the value of the key identified by key_idx. The track_idx must be the index of a Bezier Track.
Inserts a Bezier Track key at the given time in seconds. The track_idx must be the index of a Bezier Track. in_handle is the left-side weight of the added Bezier curve point, out_handle is the right-side one, while value is the actual value at this point.
Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a Bezier Track.
Sets the in handle of the key identified by key_idx to value in_handle. The track_idx must be the index of a Bezier Track.
Sets the out handle of the key identified by key_idx to value out_handle. The track_idx must be the index of a Bezier Track.
Sets the value of the key identified by key_idx to the given value. The track_idx must be the index of a Bezier Track.
Clear the animation (clear all tracks and reset all).
Adds a new track that is a copy of the given track from to_animation.
Returns the index of the specified track. If the track is not found, return -1.
Returns the amount of tracks in the animation.
Returns all the key indices of a method track, given a position and delta time.
Returns the method name of a method track.
Returns the arguments values to be called on a method track for a given key in a given track.
Removes a track by specifying the track index.
Finds the key index by time in a given track. Optionally, only find it if the exact time is given.
Returns true if the track at idx wraps the interpolation loop. New tracks wrap the interpolation loop by default.
Returns the interpolation type of a given track.
Returns the amount of keys in a given track.
Returns the time at which the key is located.
Returns the transition curve (easing) for a specific key (see the built-in math function @GDScript.ease).
Returns the value of a given key in a given track.
Gets the path of a track. For more information on the path format, see trackSetPath.
Gets the type of a track.
Insert a generic key in a given track.
Returns true if the track at index idx is enabled.
Returns true if the given track is imported. Else, return false.
Moves a track down.
Changes the index position of track idx to the one defined in to_idx.
Moves a track up.
Removes a key by index in a given track.
Removes a key by position (seconds) in a given track.
Enables/disables the given track. Tracks are enabled by default.
Sets the given track as imported or not.
If true, the track at idx wraps the interpolation loop.
Sets the interpolation type of a given track.
Sets the time of an existing key.
Sets the transition curve (easing) for a specific key (see the built-in math function @GDScript.ease).
Sets the value of an existing key.
Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ":". For example, "character/skeleton:ankle" or "character/mesh:transform/local".
Swaps the track idx's index position with the track with_idx.
Insert a transform key for a transform track.
Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position (Vector3), rotation (Quat) and scale (Vector3).
Returns all the key indices of a value track, given a position and delta time.
Returns the update mode of a value track.
Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a value track.
Sets the update mode (see updatemode) of a value track.
The total length of the animation (in seconds). Note: Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
The animation step value.
Construct a new instance of Animation. Note: use memnew!Animation instead.
# This creates an animation that makes the node "Enemy" move to the right by # 100 pixels in 0.5 seconds. var animation = Animation.new() var track_index = animation.add_track(Animation.TYPE_VALUE) animation.track_set_path(track_index, "Enemy:position:x") animation.track_insert_key(track_index, 0.0, 0) animation.track_insert_key(track_index, 0.5, 100)
Animations are just data containers, and must be added to nodes such as an AnimationPlayer or AnimationTreePlayer to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check tracktype to see available types.
Contains data used to animate everything in the engine.
An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.