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
| Field | Script name | Kind | Default | What it does | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Animations | animations | asset | none | The .anim asset this node plays. | |||||||||||||||
| Clip | clip | text | idle | Which clip is playing, by name. | |||||||||||||||
| Speed | speed | number, step 0.05 | 1 | Playback rate. Negative plays backwards. | |||||||||||||||
| Playing | playing | checkbox | on | Whether playback advances. | |||||||||||||||
| Frame Size | frame_size | checkbox | off | Draw each frame at its own size, placed by its pivot, instead of the Sprite's size. | |||||||||||||||
| Swap and culling | |||||||||||||||||||
| Culling | culling | one of AlwaysAnimate, PauseWhenOffscreen, ResetWhenOffscreen | AlwaysAnimate | Off-screen behaviour. Anything the game checks every frame must always animate. | |||||||||||||||
| Tick Mode | tick_mode | one of Frame, Unscaled | Frame | Frame keeps the game's speed; Unscaled keeps real time when a script slows the game. | |||||||||||||||
| Library | library | asset | none | The .spritelib asset this node can swap pictures from. | |||||||||||||||
| Resolver | resolver | section | โ | Which variant of that library to draw. | |||||||||||||||
| |||||||||||||||||||
Buttons
- Clear Swap Draw the clip's own art again: no library, no category, no label