CMCharacter Modules 0.1.0

How modules combine

A controller is a set of modules on one character. They never call each other; the motor combines them by a few simple rules.

One state at a time, by priority

Every state says when it may run (its entry rules: on the ground, in the air, on a button) and has a priority. Each step the motor runs the highest-priority state that may run. A ledge grab outranks the jump, the jump outranks walking, so catching a ledge mid-jump just works. The Character Motor's Inspector lists the states in this order, with the transitions between them.

Modifiers change states

A modifier says what it changes, and the reference pages spell it out: Coyote Time "lets Jump start from the Falling mode, just after walking off a ledge". Any number of modifiers can change the same state; Coyote Time and Jump Buffering both widen when a Jump may start.

Jump shapes by rank

The jump moves (double and triple, side flip, backflip, long jump, wall kick, ground pound jump...) are modifiers of one Jump. When a jump starts, each says whether it applies; the highest-ranked one chooses the launch. Add Long Jump and crouching at a run then jumping becomes a long jump; remove it and it is a plain jump.

Needs

A module that only makes sense with another says so: Coyote Time needs a Jump; Wall Kick needs Wall Bump. The Inspector warns while a need is missing.

Body facing

Some characters' bodies turn toward where they move (the third-person adventures), some toward the stick (the platformers, whose states turn the body themselves), and some never turn (the shooters, whose view is the body). A few modules only make sense with one kind and say so.

One GameObject per module

Each module lives on its own child GameObject, grouped by kind. Switching a module off is unticking it; the debug HUD's toggles do the same while playing, so you can feel what a module adds.

Hierarchy
Traversal Adventure
Input
Collision
Capsule Hull
Step Slide Solver
Sensors
Ground
Triggers
States
Swim
Ladder
Ledge Climb
Mantle
Jump
Dodge
Walk
Air
Modifiers
Coyote Time
Jump Buffering
Sprint
Jump Assist
…
Gameplay
Presentation
Camera
A preset in the Hierarchy: one child GameObject per module, grouped by kind under the Character Motor.

Additional resources