Black Week: −40% Pixor is $19.99 $11.99 until 2 December, on itch.io →

A run for any creature: the Gait node

A bought spider, wolf or crab often comes with a walk and nothing faster, and humanoid clips do not fit it. Pixor's Gait node makes the run from the creature's own legs: each foot planted while it is down, swung forward while it is up, the body carried over them.

Gait node: a spider that only walks, running on eight sides: the sheet this sample project renders

Sample project

Gait node: a spider that only walks, running on eight sides: the .pixor project and its library model (CC0). The sheet on the left is what it renders.

A pixel-art spider from the library, seen from the side, walking with the clip it came with
The spider as it came: a walk
The same spider running: four legs on the ground while the other four swing forward, then the other way round
A Gait node, Trot: a run
A sprite sheet of the spider's run: eight rows, one per side, six frames each
The run on eight sides

Beginner · about 5 minutes · or watch it in 89 seconds

1. Eight sides, 64 px

Open a rigged creature: the tutorial uses the spider from the free CC0 library. In the Scene step, click the South camera, set Game to Top-down RPG, the Pitch to 25 (a lower camera shows more of the legs), the width and height to 64, and click 8 sides.

2. One clip

In the Action step, the Actions list shows what the model came with. The spider has one clip, a walk, and nothing faster; the library clips (lib:run and the rest) are made for humanoids.

3. A Gait node

Choose Add an action › New action, then Add an action node › Gait (it is under Generators). It plays at once.

4. It finds the legs

The status line says what the node found on the rig: 8 legs (4 left, 4 right): wave. The legs are the chains of bones that end at the model’s lowest points and hang down from the body; bones named tail swing behind. On eight legs, By its legs walks them in a wave, four on each side in turn. If it cannot walk a model, it says why, naming what it found near the ground.

5. Make it run

On the Gait node in the Action graph, set Kind to Trot, Speed to 3.2, Stride to 1.6 and Foot lift to 0.3. On eight legs a trot moves two sets of four in turn, the way a running spider does, and the longer, faster stride makes a short cycle: six frames.

Setting What it does
Kind How the legs take turns. By its legs picks a walk on two or four legs, a tripod on six and a wave on eight. Trot moves diagonal legs together
Speed How fast it goes, in its legs’ lengths a second (1.6)
Stride How far it goes in one cycle, in its legs’ lengths (1)
Foot lift How high a foot is lifted, in its legs’ lengths (0.2)
Body How much the body bobs and sways and the tail swings (1; 0 is none)

6. Call it run

With the action chosen, its Name is at the top of the Inspector. Call it run. The sheet’s rows are named after it (run_South, run_West…), and a game engine finds the animation by that name.

7. The run

In the Style step, the Consistency board (B) in the 2D View shows the frame from every side at once. Each foot stays where it is on the ground while it carries the body, then swings forward in an arc and comes down where the next step starts. The heights differ by a pixel or two between sides, as its legs spread differently from each.

8. Export to Godot

In the Asset step, find godot in the node list and add File: Godot scene, then Export. Next to the sheet you get spider.tres and spider.tscn: an AnimatedSprite2D with an animation per action and side, and an AnimationTree whose move state blends the walk and the run by speed. The sheet itself has both, on eight sides each.

From the command line

pxr render spider.glb --camera top-down-rpg --pitch 25 --size 64 --ring 8 --clip none --gait trot,speed=3.2,stride=1.6,lift=0.3
pxr render deer.glb --camera top-down-rpg --pitch 25 --size 64 --ring 8 --clip none --gait walk
pxr project set game.pixor --gait trot

--gait adds one action called gait; --no-gait takes it out of a project. The other kinds are walk, tripod, wave, hop and slither.

Next

Questions

Which creatures can it walk or run?

Any rigged model whose bones reach the ground: two legs, four, six or eight. It finds the legs itself, left and right by the bones' names or by side, front and back by where they stand. A model with no legs hops, or slithers along its spine.

Do the feet slide?

No. A planted foot goes back at exactly the speed you set and keeps its height, and the body is lowered only as far as every foot needs to stay in reach. In a game that moves the sprite at that speed, the feet stand still on the ground.

Does the creature need any animation at all?

No. The Gait node needs only the rig: a creature with no clips gets a walk the same way, with Kind left at By its legs. A clip the model has, like the spider's walk, stays as it is and sits beside the run in the same sheet.

How many frames does the cycle have?

As many as the stride takes at the speed you set, rounded to a whole number of frames so the loop has no seam: six for the spider's run at 12 frames a second.

Why is the run called run?

A game engine finds it by name. Pixor's Godot scene export blends actions called idle, walk and run by speed, so naming it is all the wiring it needs.

Read next

Try it on your own model, free in your browser, or get the full version.

Try in browser Get Pixor