dreamteam-hq/brigid/gamedev-3d-platformer
Claude Code and agent skill by dreamteam-hq/brigid
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
3D sidescroller platformer mechanics in Godot 4.6 C# — CharacterBody3D movement, gravity, jump physics, state machines, camera, collision layers, and multiplayer replay
Install
npx vskill@latest install dreamteam-hq/brigid/gamedev-3d-platformerSKILL.md
The same SKILL.md was published earlier as dreamteam-hq/brigid/gamedev-3d-platformer.
3D Sidescroller Platformer Mechanics (Godot 4.6 C#)
CharacterBody3D Movement
- All movement through
Velocityproperty +MoveAndSlide()in_PhysicsProcess(double delta). IsOnFloor(),IsOnWall(),IsOnCeiling()reflect the result of the most recentMoveAndSlide()— typically read at the start of the next_PhysicsProcessframe, before the current frame'sMoveAndSlide().- Apply gravity each frame:
velocityBeforePhysics.Y -= gravity * (float)deltawheregravityis a positive value (this project's default:22f). - Horizontal movement: set
Velocity.Xfrom input direction * speed. - Sidescroller constraint: if Z drift occurs, clamp with
Position = Position with { Z = 0f }andVelocity = Velocity with { Z = 0f }each physics frame. UpDirection = Vector3.Up(default) — required forIsOnFloor()to work.
Jump Physics
- On jump press while
IsOnFloor():Velocity = Velocity with { Y = Velocity.Y + jumpVelocity }(adds to current Y). - Jump cut: on jump release while
Velocity.Y > 0, multiplyVelocity.YbyjumpCutFactor(0.3-0.5) for variable height. - Fall gravity multiplier: when
Velocity.Y < 0, applygravity * fallMultiplierinstead of base gravity for snappier descent. - Max fall speed: clamp
Velocity.YtomaxFallSpeed(negative) to prevent terminal-velocity feel. - Coyote time: track
coyoteTimer— set tocoyoteWindow(0.08-0.12s) when leaving floor, count down in_PhysicsProcess. Allow jump whilecoyoteTimer > 0. - Input buffer: on jump press while airborne, set
jumpBufferTimertojumpBufferWindow(0.1s). If player lands whilejumpBufferTimer > 0, execute jump immediately.
Run/Walk System
- Track
RunHeldbool fromInput.IsActionPressed("run"). - Target speed =
RunHeld ? runSpeed : walkSpeed. - Apply speed transitions only when
IsOnFloor()— preserve air momentum otherwise. - Smooth starts/stops:
Velocity.X = Mathf.MoveToward(Velocity.X, targetSpeed * direction, acceleration * (float)delta). - Deceleration curve (separate
decelerationconstant) when input direction is zero or opposing velocity.
Character State Machine
enum CharacterState { Idle, Walking, Running, Jumping, Falling }- Derive state after
MoveAndSlide()from physics truth:
- State drives animation selection, sound, and particle effects — never drives physics directly.
- This project's pattern: physics is authoritative, state is derived, animation follows state.
Camera
- Use
Camera3Dwith orthographic projection (Projection = ProjectionType.Orthogonal) for sidescroller feel in 3D. - Set
Sizeto control visible world units (e.g., 20 for a 20m vertical view). - Follow player with configurable
Vector3 offset— typically(0, 2, 10)to view the XY plane. - Smooth follow:
Position = Position.Lerp(target.Position + offset, (float)delta * followSpeed). - Delta clamping: cap
deltatomaxDelta(e.g., 0.1) before camera lerp to prevent teleport after debugger pause or frame hitch.
Collision Layers
- Godot uses 32 physics layers (1-indexed in editor, 0-indexed in code).
- This project's layer assignment:
- Layer 1 — Environment: static world geometry, tilemap colliders.
- Layer 2 — Player: local player's
CharacterBody3D. - Layer 3 — PlayerHurtbox:
Area3Dreceiving damage. - Layer 4 — PlayerHitbox:
Area3Ddealing damage. - Remote players: place on isolated layer (e.g., Layer 5). Clear mask bits against Layer 2 — remote players never collide with local player.
MoveAndSlide()resolves only against layers in the body'sCollisionMask. Local player masks Layer 1 (Environment) only.- Set via code:
CollisionLayer = 1 << 1; CollisionMask = 1 << 0;(player on layer 2, masks environment).
Multiplayer Replay
- Local player: capture input each
_PhysicsProcess, apply toVelocity, callMoveAndSlide(), send action payload (input vector, jump pressed, timestamp) to server. - Remote players: receive action payloads, apply identical input to their
CharacterBody3D, callMoveAndSlide(). Same physics = deterministic within floating-point tolerance. - Server snapshots: server periodically sends authoritative
(Position, Velocity). Remote players lerp toward snapshot to correct drift. - Local prediction: local player moves immediately, server confirms. On mismatch beyond threshold, snap-correct with brief interpolation.
- Both local and remote run
MoveAndSlide()— never teleport remote players directly (causes missed collisions).
One-Way Platforms
- Enable
one_way_collisionon the platform'sCollisionShape3D. - Player passes through from below, lands on top —
IsOnFloor()returns true when standing on it. - Down-jump: on down+jump input, temporarily clear the collision mask bit for the platform layer (or set
CollisionShape3D.Disabled = trueon a timer). Re-enable after ~0.2s or when player Y is below platform Y. - Use
GetSlideCollision()afterMoveAndSlide()to identify which body the player is standing on for targeted disable.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/gamedev-3d-platformer/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dreamteam-hq/brigid/gamedev-3d-platformer)