Animation¶
Doriax supports two complementary animation approaches: editor-authored keyframe
animation built in the Animation Timeline, and runtime action playback written
in code. Both are updated each frame by ActionSystem. You can mix them freely —
author the idle loop in the timeline and drive attacks and UI effects with runtime
actions.
Animation families¶
| Family | Best for | System |
|---|---|---|
| Actions | Scripted one-shot or looping motion — position, rotation, scale, color, alpha | ActionSystem, TimedAction subclasses |
| Sprite animation | 2D frame cycling through an atlas | SpriteAnimation |
| Skeletal / keyframe | Imported GLTF character clips | Animation, Model |
| Keyframe tracks | Authored transform and property curves on the timeline | TranslateTracks, RotateTracks, ScaleTracks, MorphTracks |
| Morph targets | Blend shape deformation for facial animation | MorphTracks |
| Particles | Time-based particle playback | Particles |
Runtime actions¶
Actions target an entity and update one property over time. They are lightweight, code-friendly, and do not require the timeline editor.
Available action types¶
| Class | Property controlled |
|---|---|
PositionAction |
Entity position |
RotationAction |
Entity rotation |
ScaleAction |
Entity scale |
ColorAction |
Material or UI element color |
AlphaAction |
Opacity / alpha |
TimedAction |
Callback after a duration or on each loop |
SpriteAnimation |
Sprite atlas frame sequence |
Animation |
Skeletal or keyframe clip |
Particles |
Particle system playback |
Basic action example¶
Chaining actions with callbacks¶
Use TimedAction to sequence multiple actions:
Easing curves¶
All TimedAction subclasses accept an EaseType that shapes the interpolation curve.
Common choices:
| EaseType | Best for |
|---|---|
LINEAR |
Constant-speed motion, debug |
EASE_IN_OUT_QUAD |
UI transitions and camera moves |
EASE_OUT_BOUNCE |
Playful jumps and pop-in effects |
EASE_IN_BACK |
Anticipation before a jump |
EASE_OUT_ELASTIC |
Springing UI elements |
EASE_OUT_CUBIC |
Smooth deceleration into a stop |
See TimedAction for the full EaseType
enumeration.
Sprite animation¶
SpriteAnimation cycles through a sequence of atlas frames at a fixed interval. Use
the Sprite Slicer to cut a sprite sheet into named frames
first.
Skeletal animation from GLTF¶
Import a GLTF file as a Model. The model exposes its embedded animation clips by name
or index.
GLTF can carry multiple named clips in a single file. You can play several clips simultaneously for layered animation blending.
Keyframe tracks (timeline-authored)¶
In the editor, the Animation Timeline writes keyframe data into component tracks. These are stored in the scene file and played back at runtime through the action system. The track types available are:
| Track class | Property animated |
|---|---|
TranslateTracks |
Entity position over time |
RotateTracks |
Entity rotation over time |
ScaleTracks |
Entity scale over time |
MorphTracks |
Morph target weights for shape blending |
Morph targets¶
Morph targets (blend shapes) are authored in a 3D tool such as Blender and exported
through GLTF. Use MorphTracks on a Model entity to blend between shape keys at
runtime.
Best practices¶
- Name animation clips consistently (
idle,walk,run,jump,attack). - Keep looping clips separate from one-shot clips.
- Use runtime actions for UI and gameplay feedback; use the timeline for complex authored motion.
- Avoid driving physics-controlled entities through animation — let physics simulate them and use animation only for visual overlays.
- Test frame intervals in play mode; what looks good in the editor may feel wrong at the actual game frame rate.
See also¶
- Action — base action class
- TimedAction — duration-based base
- SpriteAnimation
- Animation
- Particles
- Animation Timeline — editor authoring