Skip to content

Components

AnimatedSprite

Plays clips from a .anim asset onto a Sprite on the same node: which picture shows, at what speed, and what happens while nothing can see it. A linked library can swap its outfit or damage state without touching the clip.

On this page

Add it

+ Add node โ†’ Animated Sprite, Root Motion Character creates a node with it already on. Already have a node for it? Add component โ†’ AnimatedSpriteComponent.

From a script

A script on the same node writes these fields by name. AnimatedSpriteComponent is the name to pass.

rgs
set_text("AnimatedSpriteComponent", "clip", "idle");
set_number("AnimatedSpriteComponent", "speed", 1.0);
set_flag("AnimatedSpriteComponent", "playing", true);
set_flag("AnimatedSpriteComponent", "frame_size", false);

Fields

FieldScript nameKindDefaultWhat it does
AnimationsanimationsassetnoneThe .anim asset this node plays.
ClipcliptextidleWhich clip is playing, by name.
Speedspeednumber, step 0.051Playback rate. Negative plays backwards.
PlayingplayingcheckboxonWhether playback advances.
Frame Sizeframe_sizecheckboxoffDraw each frame at its own size, placed by its pivot, instead of the Sprite's size.
Swap and culling
Cullingcullingone of AlwaysAnimate, PauseWhenOffscreen, ResetWhenOffscreenAlwaysAnimateOff-screen behaviour. Anything the game checks every frame must always animate.
Tick Modetick_modeone of Frame, UnscaledFrameFrame keeps the game's speed; Unscaled keeps real time when a script slows the game.
LibrarylibraryassetnoneThe .spritelib asset this node can swap pictures from.
Resolverresolversectionโ€”Which variant of that library to draw.
FieldScript nameKindDefaultWhat it does
CategorycategorytextemptyCategory to swap from. Empty means the playing clip's name.
LabellabeltextemptyVariant to draw, by label. Empty draws the clip's own art.

Buttons

  • Clear Swap Draw the clip's own art again: no library, no category, no label