Skip to content

KinematicCharacterSystem Class

Drives KinematicCharacterBody components each fixed-update tick. Register two instances in DI — one at PrePhysics (pre-step: slides velocity, carries platform motion, integrates position) and one at PostPhysics (post-step: classifies contacts, updates grounded state, snaps to floor, tracks moving platform). Both instances are registered automatically by AddPhysics(). Add both to a scene with world.AddSystem<KinematicCharacterSystem>().

public class KinematicCharacterSystem : Brine2D.ECS.Systems.FixedUpdateSystemBase

Inheritance System.ObjectFixedUpdateSystemBase → KinematicCharacterSystem

Derived
PostPhysicsKinematicCharacterSystem
PrePhysicsKinematicCharacterSystem

Remarks

Box2D 3.x does not generate contact manifolds between kinematic and static bodies. All surface detection (ground, wall, ceiling) and pre-step slide deflection therefore use shape-casts rather than BodyGetContactData. Dynamic bodies (moving platforms, physics objects) are still detected via GetContactsAll because kinematic↔dynamic contacts are generated normally by Box2D.

Methods
IsOneWayPassThrough(ShapeCastHit) Returns true when a shape cast hit lands on the passthrough (non-solid) face of a one-way platform. The hit normal points toward the caster; if it opposes the platform's solid-face normal the caster is approaching from below and should not be blocked.