From dt-brigid
3D sidescroller platformer mechanics in Godot 4.6 C# — CharacterBody3D movement, gravity, jump physics, state machines, camera, collision layers, and multiplayer replay
npx claudepluginhub dreamteam-hq/brigid --plugin dt-brigidThis skill uses the workspace's default tool permissions.
- All movement through `Velocity` property + `MoveAndSlide()` in `_PhysicsProcess(double delta)`.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Velocity property + MoveAndSlide() in _PhysicsProcess(double delta).IsOnFloor(), IsOnWall(), IsOnCeiling() reflect the result of the most recent MoveAndSlide() — typically read at the start of the next _PhysicsProcess frame, before the current frame's MoveAndSlide().velocityBeforePhysics.Y -= gravity * (float)delta where gravity is a positive value (CrystalMagica default: 22f).Velocity.X from input direction * speed.Position = Position with { Z = 0f } and Velocity = Velocity with { Z = 0f } each physics frame.UpDirection = Vector3.Up (default) — required for IsOnFloor() to work.IsOnFloor(): Velocity = Velocity with { Y = Velocity.Y + jumpVelocity } (adds to current Y).Velocity.Y > 0, multiply Velocity.Y by jumpCutFactor (0.3-0.5) for variable height.Velocity.Y < 0, apply gravity * fallMultiplier instead of base gravity for snappier descent.Velocity.Y to maxFallSpeed (negative) to prevent terminal-velocity feel.coyoteTimer — set to coyoteWindow (0.08-0.12s) when leaving floor, count down in _PhysicsProcess. Allow jump while coyoteTimer > 0.jumpBufferTimer to jumpBufferWindow (0.1s). If player lands while jumpBufferTimer > 0, execute jump immediately.RunHeld bool from Input.IsActionPressed("run").RunHeld ? runSpeed : walkSpeed.IsOnFloor() — preserve air momentum otherwise.Velocity.X = Mathf.MoveToward(Velocity.X, targetSpeed * direction, acceleration * (float)delta).deceleration constant) when input direction is zero or opposing velocity.enum CharacterState { Idle, Walking, Running, Jumping, Falling }MoveAndSlide() from physics truth:CurrentState = (IsOnFloor(), moveInput != 0, Velocity.Y) switch
{
(true, false, _) => CharacterState.Idle,
(true, true, _) when !RunHeld => CharacterState.Walking,
(true, true, _) => CharacterState.Running,
(false, _, > 0) => CharacterState.Jumping,
(false, _, _) => CharacterState.Falling,
};
Camera3D with orthographic projection (Projection = ProjectionType.Orthogonal) for sidescroller feel in 3D.Size to control visible world units (e.g., 20 for a 20m vertical view).Vector3 offset — typically (0, 2, 10) to view the XY plane.Position = Position.Lerp(target.Position + offset, (float)delta * followSpeed).delta to maxDelta (e.g., 0.1) before camera lerp to prevent teleport after debugger pause or frame hitch.CharacterBody3D.Area3D receiving damage.Area3D dealing damage.MoveAndSlide() resolves only against layers in the body's CollisionMask. Local player masks Layer 1 (Environment) only.CollisionLayer = 1 << 1; CollisionMask = 1 << 0; (player on layer 2, masks environment)._PhysicsProcess, apply to Velocity, call MoveAndSlide(), send action payload (input vector, jump pressed, timestamp) to server.CharacterBody3D, call MoveAndSlide(). Same physics = deterministic within floating-point tolerance.(Position, Velocity). Remote players lerp toward snapshot to correct drift.MoveAndSlide() — never teleport remote players directly (causes missed collisions).one_way_collision on the platform's CollisionShape3D.IsOnFloor() returns true when standing on it.CollisionShape3D.Disabled = true on a timer). Re-enable after ~0.2s or when player Y is below platform Y.GetSlideCollision() after MoveAndSlide() to identify which body the player is standing on for targeted disable.