CMCharacter Modules 0.1.0

Walk

Kind: State, ground movement role · Add Component: Character Modules > States > Walk

Moves the character on the ground with acceleration and friction. These two numbers decide whether it feels snappy or heavy.

Moving on the ground: speeding up toward where the stick points and slowing down by friction. Acceleration and friction decide the feel: high for snappy shooters, lower for heavier characters. The camera decides which way is forward, and the body turns to follow.

Inspector
▼Walk⋮
CharacterCharacter (Character Motor)
Max Speed6
Acceleration10
Friction6
Stop Speed2.5
The Walk component in the Inspector, with its defaults.
Origin. Quake's ground movement (1996): accelerate toward the wish direction, then apply friction. Counter-Strike and every arena shooter keep it; third-person adventures use the same model with their own numbers.

How it works

The Walking mode: runs on walkable ground.

Moving on walkable ground, after the ground movement of classic arena shooters: friction, then acceleration toward the input direction laid onto the ground plane. Speed is kept when the slope changes, and the solver may step up ledges.

Hooks called: ISpeedScale. Reads the ground's CharacterSurface for friction and grip. Jumping is the Jump state, which takes over from here.

Combine it

  • Needs: Ground Sensor. The Inspector warns while one is missing.
  • Priority 10: when several states could run, the highest priority wins (see How modules combine).
  • Used by the presets: Arena Shooter, Competitive Shooter, Surf, Traversal Adventure, Action RPG.

Properties

PropertyDescriptionRangeDefault
CharacterThe character this module belongs to. Drag its Character Motor here.None
Max SpeedTop running speed, m/s.0 or more6
AccelerationHow quickly the character reaches top speed, per second. Higher is snappier (classic arena shooters: 10).0 or more10
FrictionHow quickly the character slows down without input, per second (classic arena shooters: 6).0 or more6
Stop SpeedBelow this speed, friction acts as if moving this fast, so stopping is quick and does not creep, m/s.0 or more2.5

Additional resources