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.

# This creates an animation that makes the node "Enemy" move to the right by# 100 pixels in 1 second.varanimation=Animation.new()vartrack_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)

Set 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 “:”.