# Animate a creature

> On paid plans, RoGenie gives a rigged creature walks, idles, swims, flaps and attacks, from ready-made presets or RoGenie's procedural animation library, and your game's code controls them with attributes.

**Animate creatures** brings a rigged creature to life: a wolf that prowls and bites, a snake that slithers, a bird that flaps and glides. It is one of the Asset Tools, on **paid plans** only. It works on one creature per request, with up to 12 animations, and the creature must be rigged first (see [Rig a model](https://rogenie.ai/docs/rig-model)).

## Where each animation comes from
For each animation you name, RoGenie picks a source, or you choose one:

- **A preset**: a ready-made clip from **Tripo**, retargeted to your creature's rig, at $0.10 per animation at official prices. Presets exist for these rig types:

  | Rig type | Preset |
  |---|---|
  | Quadruped | Walk |
  | Hexapod | Walk |
  | Octopod | Walk |
  | Serpent | March |
  | Sea creature | March |
  | Bird and other shapes | None: procedural only |
- **Procedural**: motion RoGenie's own animation library computes live in the game, from the creature's bones, with no AI model involved and no charge.

In **auto**, a walk, a move or a march on a rig type that has a preset uses the preset, and everything else is procedural.

## The procedural modules
| Module | What it does | Settings (default) |
|---|---|---|
| **Idle** | Breathing along the spine and small head movements | Breath 0.5 to 5° (1.5°), breath speed 0.1 to 1 Hz (0.25), head noise 0 to 10° (2°) |
| **LookAt** | Turns the head and neck toward a target, within limits | Yaw 10 to 120° (70°), pitch 5 to 60° (35°), speed 1 to 20 (6) |
| **Slither** | A wave travelling down the spine | Amplitude 2 to 45° (15°), wavelength 2 to 30 bones (8), speed 0.1 to 4 Hz (1.2) |
| **Swim** | A swimming wave, stronger at the tail, with fins flapping | Amplitude 2 to 40° (12°), wavelength 2 to 30 bones (6), speed 0.1 to 4 Hz (1.0), tail gain 1 to 3 (1.8) |
| **Flap** | Wing beats, and gliding | Flap speed 0.5 to 8 Hz (3), flap angle 10 to 80° (45°), glide angle 0 to 30° (8°) |
| **Lunge** | A short lunge forward | Distance 0.5 to 20 studs (3), in, hold and out times |
| **Bite** | Opens the jaw (when the rig has one) and snaps it shut | Jaw angle 5 to 60° (30°), in, hold and out times |
| **Hit** | Recoils the spine | Recoil 5 to 45° (15°), out time 0.1 to 1.5 s (0.4) |

Settings outside their range are brought back inside it. A module needs the bones it moves: **Flap** on a creature without wings is refused.

RoGenie works out the creature's bones itself (spine, neck and head, legs and feet, wings, tail and fins) from the shape of the skeleton, not from bone names, and says which groups it was unsure of.

## Controlling it from your game
RoGenie installs a small library once per place, **RoGenieCreature** in ReplicatedStorage, and a driver script, **RoGenieCreatureDriver** in StarterPlayerScripts. Each animated creature is tagged **RoGenieCreature** and holds a **RoGenieCreatureConfig** module with its bones and animations. The animation runs on each player's device, because bone movements don't replicate from the server, and creatures far from the camera are left to their Animator.

Your scripts, on the server or the client, control the creature with attributes on its model:

| Attribute | Type | What it does |
|---|---|---|
| `RoGenieCreatureState` | string | The ongoing behaviour: `idle`, `move`, `swim`, `fly`, `glide`, or the name of one of its animations |
| `RoGenieCreatureAction` | string | A one-off action: `lunge`, `bite`, `hit`, or an action's name |
| `RoGenieCreatureActionSeq` | number | A new value plays the action once more |
| `RoGenieCreatureLookAt` | Vector3 or false | A world point for the head to turn toward; `false` stops looking |

For the head to follow a part, an attachment or a model instead, give the creature an ObjectValue child named `LookTarget` pointing at it.

```lua
local wolf = workspace.Wolf
wolf:SetAttribute("RoGenieCreatureState", "move")
wolf:SetAttribute("RoGenieCreatureAction", "bite")
wolf:SetAttribute("RoGenieCreatureActionSeq", (wolf:GetAttribute("RoGenieCreatureActionSeq") or 0) + 1)
```

## Presets in a live game
A preset clip plays in a live game once it is a Roblox asset. RoGenie publishes it through the Studio plugin after the [approval card](https://rogenie.ai/docs/publishing-approval), and writes its id into the creature's config.

See [Asset costs and usage](https://rogenie.ai/docs/asset-costs) for the official prices. Animating creatures is on paid plans only.
