Gessa Docs
Recipes

Recipe

Third-person follow camera and platformer jump movement

The camera trails a visible avatar and the avatar walks, runs, and jumps over a ground plane or platforms. Use CharacterMovementComponent for arcade-feeling kinematic motion; reach for a RigidBodyComponent only when you want full dynamic Rapier physics (see physics-colliders-rigidbodies).
engine v1.0.234since component-field-contract ecs.component-field-contract.v1, action-catalog.v1.0.232, camera.v1, physics.v1Copy for LLM

Use this for

third-person adventure, platformer, runner; a follow camera behind or above the avatar; jumping, gravity, and a ground plane

Not for

first-person mouselook (use first-person-controls); flight or zero-gravity sims; strict physics ragdolls

Pairs with: First-person camera movement and mouselook controls, Camera feel field of view smoothing tone mapping and post, Physics colliders rigid bodies triggers and joints, Spawn points checkpoints and respawn flow

The recipe

  1. Create the avatar entity (project_create_entity) with TransformComponent, a RenderableComponent { "type":"RenderableComponent", "visible":true, "shape":"capsule", "renderSpace":"world" }, and a ColliderComponent (capsule, collision: "solid").
  2. Attach CharacterMovementComponent { "type":"CharacterMovementComponent", "enableKcc": true, "maxSpeed": 7, "gravity": 22, "jumpSpeed": 9, "groundY": 0 }. gravity and jumpSpeed are the vertical motor; groundY is the resting floor height.
  3. Create a SECOND entity for the camera with its own TransformComponent and a CameraComponent. Set followEntityId to the avatar's entity id and tune followOffset { "x":0, "y":6, "z":10 } (behind and above) and followSmoothing (0..1; higher lags more). Optionally set lookAtEntityId to the avatar so the camera keeps it centered.
  4. Bind a jump input: add a boolean action (for example player.jump) to the avatar's InputProfileComponent with policy.effectSystem: "movement" and a keyboard Space binding, following the default profile shape.
  5. For platform hazards or moving platforms, give those entities a ColliderComponent (collision: "solid") and, for movers, a NetworkProfileComponent { "type":"NetworkProfileComponent", "interpolation":"smooth" } so remote clients see fluid motion.

Pitfalls

  • followSmoothing is clamped 0..1. Values near 1 make the camera feel like it is on a rubber band; 0.1 to 0.2 reads tight. Default is 0.15.
  • CharacterMovementComponent has replication policy None: it is authored config consumed identically by client predictor and server authority. Do not expect it to appear in replicated snapshots.
  • Do not author VelocityComponent to launch a jump; it is a hidden internal runtime lane. Configure jumpSpeed on movement, or from a script call ctx.physics.command with { type: "launch" }.
  • The follow camera must be a different entity from the avatar, or followOffset has nothing to offset from.

Verify

  • project_get_graph_snapshot to confirm the camera entity's followEntityId resolves to the avatar id.
  • simulation_run to prove the avatar jumps and lands at groundY.
  • qa_capture_renderer_viewport to confirm the avatar is framed by the follow camera.
Was this helpful?Report an issueContact support

On this page