summer-engine 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +27 -5
- package/.codex-plugin/plugin.json +28 -6
- package/.cursor-plugin/plugin.json +27 -5
- package/.factory-plugin/plugin.json +27 -5
- package/.opencode/plugins/summer.js +1 -1
- package/CHANGELOG.md +102 -0
- package/README.md +18 -3
- package/assets/audit/scene_audit.gd +4136 -0
- package/assets/seeing/seeing_probe.gd +1873 -0
- package/dist/cli/commands/skills.js +20 -2
- package/dist/core/api-client.d.ts +9 -1
- package/dist/core/api-client.js +21 -4
- package/dist/core/capabilities/agent-playbook.js +46 -0
- package/dist/core/capabilities/audit/accept.d.ts +55 -0
- package/dist/core/capabilities/audit/accept.js +147 -0
- package/dist/core/capabilities/audit/args.d.ts +95 -0
- package/dist/core/capabilities/audit/args.js +89 -0
- package/dist/core/capabilities/audit/audit.d.ts +56 -0
- package/dist/core/capabilities/audit/audit.js +287 -0
- package/dist/core/capabilities/audit/frame.d.ts +14 -0
- package/dist/core/capabilities/audit/frame.js +35 -0
- package/dist/core/capabilities/audit/gaps.d.ts +96 -0
- package/dist/core/capabilities/audit/gaps.js +257 -0
- package/dist/core/capabilities/audit/judge.d.ts +162 -0
- package/dist/core/capabilities/audit/judge.js +1134 -0
- package/dist/core/capabilities/audit/math.d.ts +110 -0
- package/dist/core/capabilities/audit/math.js +263 -0
- package/dist/core/capabilities/audit/summary.d.ts +74 -0
- package/dist/core/capabilities/audit/summary.js +212 -0
- package/dist/core/capabilities/board.d.ts +31 -0
- package/dist/core/capabilities/board.js +43 -0
- package/dist/core/capabilities/camera-view.d.ts +4 -2
- package/dist/core/capabilities/camera-view.js +6 -3
- package/dist/core/capabilities/connect-signal.d.ts +85 -0
- package/dist/core/capabilities/connect-signal.js +285 -0
- package/dist/core/capabilities/engine-fallbacks.d.ts +5 -0
- package/dist/core/capabilities/engine-fallbacks.js +5 -0
- package/dist/core/capabilities/engine-ops.d.ts +5 -1
- package/dist/core/capabilities/engine-ops.js +0 -3
- package/dist/core/capabilities/engine-receipt.d.ts +12 -0
- package/dist/core/capabilities/engine-receipt.js +26 -0
- package/dist/core/capabilities/file-read.d.ts +64 -0
- package/dist/core/capabilities/file-read.js +325 -0
- package/dist/core/capabilities/game-task-plan.js +4 -2
- package/dist/core/capabilities/grep.d.ts +60 -0
- package/dist/core/capabilities/grep.js +190 -0
- package/dist/core/capabilities/inspect-node.d.ts +56 -0
- package/dist/core/capabilities/inspect-node.js +225 -0
- package/dist/core/capabilities/inspect-resource.d.ts +61 -0
- package/dist/core/capabilities/inspect-resource.js +376 -0
- package/dist/core/capabilities/math3d.d.ts +28 -0
- package/dist/core/capabilities/math3d.js +88 -0
- package/dist/core/capabilities/motion-generation.d.ts +62 -0
- package/dist/core/capabilities/motion-generation.js +138 -0
- package/dist/core/capabilities/placement-batch.d.ts +102 -0
- package/dist/core/capabilities/placement-batch.js +483 -0
- package/dist/core/capabilities/placement-math.d.ts +70 -0
- package/dist/core/capabilities/placement-math.js +209 -0
- package/dist/core/capabilities/placement-script.d.ts +42 -0
- package/dist/core/capabilities/placement-script.js +1096 -0
- package/dist/core/capabilities/placement.d.ts +485 -0
- package/dist/core/capabilities/placement.js +1731 -0
- package/dist/core/capabilities/project-context.d.ts +33 -2
- package/dist/core/capabilities/project-context.js +87 -4
- package/dist/core/capabilities/replace-node.d.ts +91 -0
- package/dist/core/capabilities/replace-node.js +423 -0
- package/dist/core/capabilities/runtime-control.d.ts +18 -2
- package/dist/core/capabilities/runtime-control.js +67 -2
- package/dist/core/capabilities/scene-batch.d.ts +63 -0
- package/dist/core/capabilities/scene-batch.js +394 -0
- package/dist/core/capabilities/scene-readback.d.ts +36 -0
- package/dist/core/capabilities/scene-readback.js +54 -0
- package/dist/core/capabilities/seeing/args.d.ts +348 -0
- package/dist/core/capabilities/seeing/args.js +178 -0
- package/dist/core/capabilities/seeing/candidates.d.ts +127 -0
- package/dist/core/capabilities/seeing/candidates.js +282 -0
- package/dist/core/capabilities/seeing/math.d.ts +134 -0
- package/dist/core/capabilities/seeing/math.js +269 -0
- package/dist/core/capabilities/seeing/probe.d.ts +62 -0
- package/dist/core/capabilities/seeing/probe.js +188 -0
- package/dist/core/capabilities/seeing/scoring.d.ts +235 -0
- package/dist/core/capabilities/seeing/scoring.js +639 -0
- package/dist/core/capabilities/seeing/seeing.d.ts +233 -0
- package/dist/core/capabilities/seeing/seeing.js +1341 -0
- package/dist/core/capabilities/seeing/shot-store.d.ts +52 -0
- package/dist/core/capabilities/seeing/shot-store.js +204 -0
- package/dist/core/capabilities/surface-snap-mesh.d.ts +88 -0
- package/dist/core/capabilities/surface-snap-mesh.js +425 -0
- package/dist/core/capabilities/surface-snap.d.ts +77 -0
- package/dist/core/capabilities/surface-snap.js +461 -0
- package/dist/core/capabilities/tool-dispatch.js +231 -72
- package/dist/core/capabilities/tscn.d.ts +85 -0
- package/dist/core/capabilities/tscn.js +391 -0
- package/dist/core/capabilities/world-snapshot.d.ts +58 -0
- package/dist/core/capabilities/world-snapshot.js +150 -0
- package/dist/core/capability-skew.d.ts +5 -5
- package/dist/core/capability-skew.js +14 -6
- package/dist/core/headless/worker-engine-client.d.ts +1 -1
- package/dist/core/headless/worker-engine-client.js +2 -2
- package/dist/core/library-read.d.ts +37 -5
- package/dist/core/library-read.js +264 -33
- package/dist/core/library-search.d.ts +2 -2
- package/dist/installer/agent-config.js +5 -3
- package/dist/installer/agent-table.d.ts +16 -0
- package/dist/installer/agent-table.js +52 -17
- package/dist/mcp/server.js +9 -3
- package/dist/mcp/tools/asset-tools.js +21 -3
- package/dist/mcp/tools/audit-tools.d.ts +23 -0
- package/dist/mcp/tools/audit-tools.js +60 -0
- package/dist/mcp/tools/debug-tools.js +3 -1
- package/dist/mcp/tools/file-tools.js +17 -4
- package/dist/mcp/tools/generate-tools.js +74 -66
- package/dist/mcp/tools/library-tools.js +2 -0
- package/dist/mcp/tools/perception-tools.js +6 -19
- package/dist/mcp/tools/placement-tools.d.ts +24 -0
- package/dist/mcp/tools/placement-tools.js +91 -0
- package/dist/mcp/tools/project-tools.js +18 -15
- package/dist/mcp/tools/scene-tools.js +71 -83
- package/dist/mcp/tools/seeing-tools.d.ts +24 -0
- package/dist/mcp/tools/seeing-tools.js +64 -0
- package/dist/mcp/tools/spatial-tools.js +17 -9
- package/dist/mcp/tools/visual-tools.js +59 -7
- package/gemini-extension.json +26 -4
- package/integrations/amp/README.md +1 -1
- package/integrations/crush/README.md +1 -1
- package/integrations/grok-build/README.md +1 -1
- package/integrations/hermes/README.md +1 -1
- package/integrations/kimi-code/README.md +1 -1
- package/integrations/mistral-vibe/README.md +1 -1
- package/integrations/opencode/README.md +1 -1
- package/integrations/rovo-dev/README.md +1 -1
- package/integrations/vscode-copilot/README.md +1 -1
- package/integrations/warp/README.md +1 -1
- package/integrations/windsurf/README.md +1 -1
- package/library/references/mcp-tools-reference/mcp-tools-reference.md +59 -15
- package/library/references/mcp-tools-reference/resource.yaml +1 -1
- package/library/references/summer-folder/resource.yaml +1 -1
- package/library/references/summer-folder/summer-folder.md +1 -1
- package/library/skills/3d-lighting/SKILL.md +1 -1
- package/library/skills/README.md +36 -14
- package/library/skills/adaptive-music/SKILL.md +1 -1
- package/library/skills/agent-playtesting/SKILL.md +1 -1
- package/library/skills/ai-characters-in-games/SKILL.md +220 -0
- package/library/skills/ai-characters-in-games/resource.yaml +30 -0
- package/library/skills/ambient-bed/SKILL.md +1 -1
- package/library/skills/animated-loop/SKILL.md +1 -1
- package/library/skills/animation-tree/SKILL.md +1 -1
- package/library/skills/art-direction/SKILL.md +1 -1
- package/library/skills/asset-strategy/SKILL.md +2 -1
- package/library/skills/asset-strategy/resource.yaml +2 -1
- package/library/skills/audio-direction/SKILL.md +1 -1
- package/library/skills/auto-fire-targeting/SKILL.md +1 -1
- package/library/skills/brainstorm-game/SKILL.md +1 -1
- package/library/skills/brainstorming/SKILL.md +1 -1
- package/library/skills/browse-templates/SKILL.md +3 -3
- package/library/skills/browse-templates/resource.yaml +1 -1
- package/library/skills/camera-rigs/SKILL.md +128 -0
- package/library/skills/camera-rigs/resource.yaml +29 -0
- package/library/skills/celeste-momentum-platforming/SKILL.md +1 -1
- package/library/skills/character-animation-wiring/SKILL.md +1 -1
- package/library/skills/character-model/SKILL.md +1 -1
- package/library/skills/character-movement/SKILL.md +326 -0
- package/library/skills/character-movement/references/default-third-person-controller.gd +201 -0
- package/library/skills/character-movement/references/default-third-person-verification-probe.gd +154 -0
- package/library/skills/character-movement/references/movement-3d.md +136 -0
- package/library/skills/character-movement/references/platformer-feel.md +83 -0
- package/library/skills/character-movement/resource.yaml +40 -0
- package/library/skills/character-portrait/SKILL.md +1 -1
- package/library/skills/cinematic-cutscene/SKILL.md +1 -1
- package/library/skills/combat-basics/SKILL.md +159 -0
- package/library/skills/combat-basics/references/projectiles-and-aoe.md +100 -0
- package/library/skills/combat-basics/resource.yaml +34 -0
- package/library/skills/concept-art/SKILL.md +1 -1
- package/library/skills/create-asset-sheet/SKILL.md +1 -1
- package/library/skills/debug/SKILL.md +1 -1
- package/library/skills/debugging-game-feel/SKILL.md +1 -1
- package/library/skills/design-level/SKILL.md +1 -1
- package/library/skills/design-mechanic/SKILL.md +1 -1
- package/library/skills/design-npc/SKILL.md +1 -1
- package/library/skills/diagnosing-perf-regressions/SKILL.md +1 -1
- package/library/skills/dispatching-parallel-agents/SKILL.md +1 -1
- package/library/skills/driving-the-editor-ui/SKILL.md +1 -1
- package/library/skills/environment-kit/SKILL.md +1 -1
- package/library/skills/export-and-ship/SKILL.md +1 -1
- package/library/skills/fabricating-assets/SKILL.md +1 -1
- package/library/skills/facial-and-lipsync/SKILL.md +1 -1
- package/library/skills/fps-controller/SKILL.md +9 -7
- package/library/skills/fps-controller/resource.yaml +4 -1
- package/library/skills/game-feel/SKILL.md +1 -1
- package/library/skills/gameskill/SKILL.md +1 -1
- package/library/skills/gdscript-patterns/SKILL.md +1 -1
- package/library/skills/generate-motion/SKILL.md +9 -9
- package/library/skills/generate-motion/resource.yaml +2 -1
- package/library/skills/godogen-visual-proof-game-generation/SKILL.md +1 -1
- package/library/skills/headless-scripting/SKILL.md +1 -1
- package/library/skills/in-game-purchases/SKILL.md +254 -0
- package/library/skills/in-game-purchases/resource.yaml +29 -0
- package/library/skills/instantiate-asset-pack/SKILL.md +1 -1
- package/library/skills/investigating-bugs/SKILL.md +1 -1
- package/library/skills/lumera-single-image-scene-reconstruction/SKILL.md +1 -1
- package/library/skills/make-game/SKILL.md +25 -3
- package/library/skills/make-game/references/2d-platformer-polish.md +93 -0
- package/library/skills/make-game/references/2d-platformer.md +117 -0
- package/library/skills/make-game/references/2d-rpg-content.md +234 -0
- package/library/skills/make-game/references/2d-rpg.md +241 -0
- package/library/skills/make-game/references/2d-survivors-progression.md +201 -0
- package/library/skills/make-game/references/2d-survivors.md +237 -0
- package/library/skills/make-game/references/3d-fps-systems.md +216 -0
- package/library/skills/make-game/references/3d-fps.md +177 -0
- package/library/skills/make-game/references/3d-horror-systems.md +186 -0
- package/library/skills/make-game/references/3d-horror.md +201 -0
- package/library/skills/make-game/references/3d-third-person-systems.md +220 -0
- package/library/skills/make-game/references/3d-third-person.md +215 -0
- package/library/skills/make-game/resource.yaml +6 -1
- package/library/skills/multiplayer/SKILL.md +150 -0
- package/library/skills/multiplayer/resource.yaml +33 -0
- package/library/skills/multiplayer-movement/SKILL.md +510 -0
- package/library/skills/multiplayer-movement/files.md +501 -0
- package/library/skills/multiplayer-movement/resource.yaml +30 -0
- package/library/skills/multiplayer-project/SKILL.md +521 -0
- package/library/skills/multiplayer-project/files.md +448 -0
- package/library/skills/multiplayer-project/resource.yaml +36 -0
- package/library/skills/multiplayer-publish/SKILL.md +229 -0
- package/library/skills/multiplayer-publish/export-errors.md +89 -0
- package/library/skills/multiplayer-publish/resource.yaml +28 -0
- package/library/skills/multiplayer-state/SKILL.md +438 -0
- package/library/skills/multiplayer-state/files.md +592 -0
- package/library/skills/multiplayer-state/resource.yaml +35 -0
- package/library/skills/multiplayer-testing/SKILL.md +236 -0
- package/library/skills/multiplayer-testing/resource.yaml +39 -0
- package/library/skills/music-track/SKILL.md +1 -1
- package/library/skills/navigate-summer/SKILL.md +1 -1
- package/library/skills/new-project/SKILL.md +1 -1
- package/library/skills/organic-model/SKILL.md +1 -1
- package/library/skills/pixel-art/SKILL.md +1 -1
- package/library/skills/play/SKILL.md +1 -1
- package/library/skills/playtesting-a-feature/SKILL.md +1 -1
- package/library/skills/procedural-animation/SKILL.md +2 -2
- package/library/skills/procedural-animation/resource.yaml +1 -1
- package/library/skills/prop-model/SKILL.md +1 -1
- package/library/skills/psx-retro-rendering/SKILL.md +1 -1
- package/library/skills/realtime-wet-surfaces/SKILL.md +2 -2
- package/library/skills/remote-deploy/SKILL.md +1 -1
- package/library/skills/retarget/SKILL.md +1 -1
- package/library/skills/running-in-the-cloud/SKILL.md +1 -1
- package/library/skills/save-load/SKILL.md +156 -0
- package/library/skills/save-load/resource.yaml +27 -0
- package/library/skills/scene-composition/SKILL.md +1 -1
- package/library/skills/scene-hierarchy-design/SKILL.md +1 -1
- package/library/skills/scene-scripting/SKILL.md +1 -1
- package/library/skills/scene-to-level/SKILL.md +1 -1
- package/library/skills/skill-create/SKILL.md +1 -1
- package/library/skills/skill-improve/SKILL.md +1 -1
- package/library/skills/skill-test/SKILL.md +1 -1
- package/library/skills/skintokens-auto-rigging/SKILL.md +1 -1
- package/library/skills/skybox-panorama/SKILL.md +1 -1
- package/library/skills/sound-effect/SKILL.md +1 -1
- package/library/skills/spatial-placement/SKILL.md +134 -3
- package/library/skills/spatial-placement/references/kit-placement-tools.md +364 -0
- package/library/skills/spatial-placement/resource.yaml +16 -2
- package/library/skills/sprite-sheet/SKILL.md +1 -1
- package/library/skills/summer-analytics/SKILL.md +147 -0
- package/library/skills/summer-analytics/resource.yaml +28 -0
- package/library/skills/summer-friends/SKILL.md +226 -0
- package/library/skills/summer-friends/resource.yaml +28 -0
- package/library/skills/summer-leaderboards/SKILL.md +231 -0
- package/library/skills/summer-leaderboards/resource.yaml +30 -0
- package/library/skills/summer-match-results/SKILL.md +286 -0
- package/library/skills/summer-match-results/resource.yaml +32 -0
- package/library/skills/summer-matchmaking/SKILL.md +301 -0
- package/library/skills/summer-matchmaking/resource.yaml +32 -0
- package/library/skills/summer-parties/SKILL.md +253 -0
- package/library/skills/summer-parties/resource.yaml +30 -0
- package/library/skills/summer-player-data/SKILL.md +322 -0
- package/library/skills/summer-player-data/resource.yaml +30 -0
- package/library/skills/summer-store/SKILL.md +271 -0
- package/library/skills/summer-store/resource.yaml +29 -0
- package/library/skills/summer-world-chat/SKILL.md +195 -0
- package/library/skills/summer-world-chat/resource.yaml +30 -0
- package/library/skills/summer-world-saves/SKILL.md +284 -0
- package/library/skills/summer-world-saves/resource.yaml +29 -0
- package/library/skills/text-to-motion/SKILL.md +99 -0
- package/library/skills/text-to-motion/prompts-and-controls.md +34 -0
- package/library/skills/text-to-motion/resource.yaml +41 -0
- package/library/skills/text-to-motion/rigging-for-text-motion.md +54 -0
- package/library/skills/tileable-texture/SKILL.md +1 -1
- package/library/skills/trailer-shot/SKILL.md +1 -1
- package/library/skills/tune-performance/SKILL.md +1 -1
- package/library/skills/ui-basics/SKILL.md +10 -1
- package/library/skills/ui-graphics/SKILL.md +1 -1
- package/library/skills/use-widget-asset/SKILL.md +1 -1
- package/library/skills/using-summer/SKILL.md +2 -2
- package/library/skills/using-summer/resource.yaml +2 -2
- package/library/skills/vehicle-model/SKILL.md +1 -1
- package/library/skills/verification-before-completion/SKILL.md +1 -1
- package/library/skills/verifying-scenes/SKILL.md +76 -2
- package/library/skills/verifying-scenes/resource.yaml +13 -2
- package/library/skills/vfx-dissolve/SKILL.md +1 -1
- package/library/skills/vfx-fire/SKILL.md +1 -1
- package/library/skills/vfx-hit-spark/SKILL.md +1 -1
- package/library/skills/vfx-lightning/SKILL.md +1 -1
- package/library/skills/vfx-magic-glow/SKILL.md +1 -1
- package/library/skills/vfx-muzzle-flash/SKILL.md +1 -1
- package/library/skills/vfx-smoke/SKILL.md +1 -1
- package/library/skills/vfx-water-ripple/SKILL.md +1 -1
- package/library/skills/voice-line/SKILL.md +1 -1
- package/library/skills/web-and-touch-input/SKILL.md +38 -0
- package/library/skills/web-and-touch-input/resource.yaml +28 -0
- package/library/skills/web-compatibility-look/SKILL.md +62 -0
- package/library/skills/web-compatibility-look/resource.yaml +30 -0
- package/library/skills/world-building-3d/SKILL.md +8 -1
- package/library/skills/world-building-3d/references/spatial-tools.md +1 -1
- package/library/skills/world-building-3d/resource.yaml +2 -1
- package/library/skills/writing-plans/SKILL.md +1 -1
- package/library/skills/writing-skills/SKILL.md +1 -1
- package/library/templates/3d-lan-multiplayer-starter/resource.yaml +2 -2
- package/library/tools/attach-to-surface/resource.yaml +142 -0
- package/library/tools/batch/resource.yaml +9 -3
- package/library/tools/connect-ports/resource.yaml +120 -0
- package/library/tools/connect-signal/resource.yaml +3 -2
- package/library/tools/debug-views/resource.yaml +94 -0
- package/library/tools/frame-nodes/resource.yaml +104 -0
- package/library/tools/frame-shot/resource.yaml +134 -0
- package/library/tools/generate-motion/resource.yaml +44 -9
- package/library/tools/get-board/resource.yaml +50 -0
- package/library/tools/get-project-context/resource.yaml +13 -2
- package/library/tools/grep/resource.yaml +77 -0
- package/library/tools/inspect-asset/resource.yaml +71 -0
- package/library/tools/inspect-node/resource.yaml +9 -2
- package/library/tools/inspect-resource/resource.yaml +16 -5
- package/library/tools/instantiate-scene/resource.yaml +27 -2
- package/library/tools/measure/resource.yaml +96 -0
- package/library/tools/place-adjacent/resource.yaml +113 -0
- package/library/tools/play/resource.yaml +15 -2
- package/library/tools/raycast/resource.yaml +101 -0
- package/library/tools/read-file/resource.yaml +36 -2
- package/library/tools/read-library/resource.yaml +2 -2
- package/library/tools/repeat-along/resource.yaml +129 -0
- package/library/tools/replace-node/resource.yaml +11 -5
- package/library/tools/scene-audit/resource.yaml +144 -0
- package/library/tools/screenshot/resource.yaml +13 -2
- package/library/tools/search-assets/resource.yaml +18 -0
- package/library/tools/shot-sheet/resource.yaml +110 -0
- package/library/tools/snap-to-surface/resource.yaml +4 -1
- package/library/tools/world-snapshot/resource.yaml +24 -3
- package/library/tools/zoom/resource.yaml +105 -0
- package/package.json +1 -1
- package/registry/generated/aliases.json +17 -3
- package/registry/generated/counts.json +3 -3
- package/registry/generated/gemini-extension.json +26 -4
- package/registry/generated/index.json +2154 -469
- package/registry/generated/marketplace.claude.json +2 -2
- package/registry/generated/plugin.claude.json +27 -5
- package/registry/generated/plugin.codex.json +28 -6
- package/registry/generated/plugin.cursor.json +27 -5
- package/registry/generated/plugin.factory.json +27 -5
- package/registry/generated/skills-index.md +36 -14
- package/registry/generated/skills-registry.json +421 -124
- package/registry/generated/templates-registry.json +2 -2
- package/library/skills/host-authoritative-state/SKILL.md +0 -332
- package/library/skills/host-authoritative-state/resource.yaml +0 -28
- package/library/skills/peer-to-peer-multiplayer/SKILL.md +0 -373
- package/library/skills/peer-to-peer-multiplayer/resource.yaml +0 -28
- package/library/skills/setup-multiplayer/SKILL.md +0 -336
- package/library/skills/setup-multiplayer/resource.yaml +0 -28
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: camera-rigs
|
|
3
|
+
description: "Camera rigs for 2D and 3D: Camera2D follow with limits, first-person head camera, SpringArm3D third-person, orthographic top-down, FOV guidance."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: [Cursor, Claude Code, Codex, Windsurf, Gemini, OpenCode]
|
|
6
|
+
category: scene-and-project
|
|
7
|
+
user-invocable: false
|
|
8
|
+
allowed-tools: Read Grep summer_get_scene_tree summer_inspect_node summer_add_node summer_set_prop summer_batch summer_save_scene summer_screenshot summer_play summer_stop summer_get_diagnostics
|
|
9
|
+
paths: ["**/*.tscn", "**/*.gd"]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Camera Rigs
|
|
13
|
+
|
|
14
|
+
One rule above all: exactly ONE camera is active. In 3D that is the single
|
|
15
|
+
`Camera3D` with `current = true`; two current cameras = flicker or the wrong
|
|
16
|
+
view, and a scene with no current camera renders nothing in the game. In 2D a
|
|
17
|
+
`Camera2D` is active when `enabled = true` (the default) and it is in the tree;
|
|
18
|
+
with several enabled cameras, call `make_current()` on the one you want.
|
|
19
|
+
|
|
20
|
+
Trigger phrases: "black screen on play", "camera shows past the level edge",
|
|
21
|
+
"jerky follow", "wrong FOV", "I need a top-down / isometric / orbit camera".
|
|
22
|
+
|
|
23
|
+
Ops use engine variant strings (`"Vector3(0, 5, 10)"`), never JSON objects
|
|
24
|
+
(`{x: 0, y: 5, z: 10}` fails). Every mutation names its scene: pass the exact
|
|
25
|
+
`scenePath` (e.g. `res://main.tscn`). One `summer_batch` per rig saves the scene
|
|
26
|
+
once; the examples below use it.
|
|
27
|
+
|
|
28
|
+
## 2D follow camera
|
|
29
|
+
|
|
30
|
+
Add the `Camera2D` as a CHILD of the player so it follows for free, then smooth
|
|
31
|
+
it and clamp it to the level.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
summer_batch(scenePath="res://main.tscn", ops=[
|
|
35
|
+
{"op": "AddNode", "parent": "./Player", "type": "Camera2D", "name": "Camera"},
|
|
36
|
+
{"op": "SetProp", "path": "./Player/Camera", "key": "position_smoothing_enabled", "value": true},
|
|
37
|
+
{"op": "SetProp", "path": "./Player/Camera", "key": "position_smoothing_speed", "value": 6.0},
|
|
38
|
+
{"op": "SetProp", "path": "./Player/Camera", "key": "limit_left", "value": 0},
|
|
39
|
+
{"op": "SetProp", "path": "./Player/Camera", "key": "limit_right", "value": 1920},
|
|
40
|
+
{"op": "SetProp", "path": "./Player/Camera", "key": "limit_top", "value": 0},
|
|
41
|
+
{"op": "SetProp", "path": "./Player/Camera", "key": "limit_bottom", "value": 1080}
|
|
42
|
+
])
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Smoothing speed 5-8 feels responsive; higher = tighter, lower = drifty.
|
|
46
|
+
- Set limits to the actual level bounds (the numbers above are placeholders).
|
|
47
|
+
`limit_smoothing_enabled = true` avoids a hard stop at the edge.
|
|
48
|
+
- Zoom `Vector2(2, 2)` zooms IN (bigger), `Vector2(0.5, 0.5)` zooms OUT (top-down).
|
|
49
|
+
|
|
50
|
+
## 2D top-down camera
|
|
51
|
+
|
|
52
|
+
Same as above minus the platformer edge-lock urgency. Zoom out to show the field
|
|
53
|
+
(`Vector2(0.5, 0.5)`). Keep it centered on the player; no vertical bias.
|
|
54
|
+
|
|
55
|
+
## 3D first-person camera
|
|
56
|
+
|
|
57
|
+
Camera is a child of a `Head` node on the player. Body yaws, Head pitches. See
|
|
58
|
+
the `character-movement` skill (its `../character-movement/references/movement-3d.md`) or
|
|
59
|
+
`fps-controller` for the look script. FOV 70-75, near 0.05.
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
summer_batch(scenePath="res://main.tscn", ops=[
|
|
63
|
+
{"op": "AddNode", "parent": "./Player/Head", "type": "Camera3D", "name": "Camera"},
|
|
64
|
+
{"op": "SetProp", "path": "./Player/Head/Camera", "key": "fov", "value": 72.0},
|
|
65
|
+
{"op": "SetProp", "path": "./Player/Head/Camera", "key": "near", "value": 0.05},
|
|
66
|
+
{"op": "SetProp", "path": "./Player/Head/Camera", "key": "current", "value": true}
|
|
67
|
+
])
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 3D third-person camera (spring arm)
|
|
71
|
+
|
|
72
|
+
The `SpringArm3D` pushes the camera in when a wall is behind the player, so it
|
|
73
|
+
never clips through geometry. This is the correct third-person rig - do not just
|
|
74
|
+
park a Camera3D behind the player.
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
summer_batch(scenePath="res://main.tscn", ops=[
|
|
78
|
+
{"op": "AddNode", "parent": "./Player", "type": "SpringArm3D", "name": "SpringArm"},
|
|
79
|
+
{"op": "SetProp", "path": "./Player/SpringArm", "key": "position", "value": "Vector3(0, 2, 0)"},
|
|
80
|
+
{"op": "SetProp", "path": "./Player/SpringArm", "key": "spring_length", "value": 4.5},
|
|
81
|
+
{"op": "SetProp", "path": "./Player/SpringArm", "key": "collision_mask", "value": 2},
|
|
82
|
+
{"op": "AddNode", "parent": "./Player/SpringArm", "type": "Camera3D", "name": "Camera"},
|
|
83
|
+
{"op": "SetProp", "path": "./Player/SpringArm/Camera", "key": "current", "value": true}
|
|
84
|
+
])
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Set `collision_mask` to the LEVEL layer only. If it includes the player layer the
|
|
88
|
+
arm collapses to length 0 and you see inside the character (a controller script
|
|
89
|
+
can also call `add_excluded_object(get_rid())` on the arm).
|
|
90
|
+
|
|
91
|
+
## Orthographic top-down 3D (twin-stick, strategy, isometric)
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
summer_batch(scenePath="res://main.tscn", ops=[
|
|
95
|
+
{"op": "SetProp", "path": "./Camera", "key": "projection", "value": 1},
|
|
96
|
+
{"op": "SetProp", "path": "./Camera", "key": "size", "value": 20.0},
|
|
97
|
+
{"op": "SetProp", "path": "./Camera", "key": "position", "value": "Vector3(0, 20, 0)"},
|
|
98
|
+
{"op": "SetProp", "path": "./Camera", "key": "rotation_degrees", "value": "Vector3(-90, 0, 0)"}
|
|
99
|
+
])
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`projection = 1` is orthogonal. `size` is the vertical world units shown - bigger
|
|
103
|
+
= more zoomed out. For isometric, rotate ~(-30, 45, 0) instead of straight down.
|
|
104
|
+
|
|
105
|
+
## FOV guidance
|
|
106
|
+
|
|
107
|
+
- 60-75: most 3D games. 90+: fast FPS (feels faster, more peripheral).
|
|
108
|
+
- Under 40 or over 110 distorts. Never animate FOV wildly; a small kick (+8 on
|
|
109
|
+
sprint, tweened back) reads as speed.
|
|
110
|
+
|
|
111
|
+
## Verify
|
|
112
|
+
|
|
113
|
+
A camera is only proven by a frame. After the rig is in, `summer_play`, then
|
|
114
|
+
`summer_screenshot` with `target: "game"`, then `summer_stop`; or save frames
|
|
115
|
+
from a `RunVerification` probe while the player moves (see
|
|
116
|
+
`playtesting-a-feature`). An editor `viewport` screenshot shows the editor's
|
|
117
|
+
camera, not the game's.
|
|
118
|
+
|
|
119
|
+
## Troubleshooting
|
|
120
|
+
|
|
121
|
+
| Symptom | Cause | Fix |
|
|
122
|
+
|---------|-------|-----|
|
|
123
|
+
| Black screen | No current/enabled camera | 3D: `current = true` on exactly one; 2D: one enabled Camera2D in the tree |
|
|
124
|
+
| Camera inside geometry | Spawned inside a wall/player | Move it out; spring arm for 3P |
|
|
125
|
+
| Jerky follow | Smoothing off/too slow | Enable smoothing, speed 6-10 |
|
|
126
|
+
| Shows past level edge | No 2D limits | Set `limit_*` to level bounds |
|
|
127
|
+
| Wrong facing (3D) | rotation.y off | y: 0 = forward, 180 = backward |
|
|
128
|
+
| Everything tiny/huge (ortho) | `size` wrong | Tune `size`, not `position.y` |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
id: skill/camera-rigs
|
|
2
|
+
kind: skill
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
summary: "Camera rigs for 2D and 3D: Camera2D follow with limits, first-person head camera, SpringArm3D third-person, orthographic top-down, FOV guidance."
|
|
5
|
+
use_when:
|
|
6
|
+
- black screen on play, or the camera shows past the level edge
|
|
7
|
+
- jerky camera follow, wrong FOV, or the third-person camera clips into walls
|
|
8
|
+
- need a top-down, isometric, orthographic, orbit, or spring-arm camera
|
|
9
|
+
facets:
|
|
10
|
+
lifecycle:
|
|
11
|
+
- build
|
|
12
|
+
domains:
|
|
13
|
+
- scenes
|
|
14
|
+
- 3d
|
|
15
|
+
- 2d
|
|
16
|
+
modalities:
|
|
17
|
+
- scenes
|
|
18
|
+
- scripts
|
|
19
|
+
compatibility:
|
|
20
|
+
engine: ">=4.6"
|
|
21
|
+
related:
|
|
22
|
+
skills:
|
|
23
|
+
- skill/make-game
|
|
24
|
+
- skill/character-movement
|
|
25
|
+
- skill/fps-controller
|
|
26
|
+
source: official
|
|
27
|
+
license: MIT
|
|
28
|
+
status: preview
|
|
29
|
+
recommended: false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: celeste-momentum-platforming
|
|
3
|
-
description: "
|
|
3
|
+
description: "Celeste-style 2D precision platformer movement — momentum running, coyote time, variable jumps, dash, wall jump/slide, climb stamina, pixel corner correction."
|
|
4
4
|
license: MIT
|
|
5
5
|
category: game-feel
|
|
6
6
|
tags:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: character-animation-wiring
|
|
3
|
-
description:
|
|
3
|
+
description: "Wire a rigged, animated character end to end — inspect real clips and bones, locomotion state machine, method-track events, poses, blend shapes, root motion."
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: [Cursor, Claude Code, Windsurf, Codex]
|
|
6
6
|
category: animation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: character-model
|
|
3
|
-
description:
|
|
3
|
+
description: "Generate a rigged humanoid — player, NPC, enemy, boss — via T-pose reference, user-gated preview, and Meshy auto-rig, wired as CharacterBody3D or Node3D."
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: [Cursor, Claude Code, Windsurf, Codex]
|
|
6
6
|
category: 3d-assets
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: character-movement
|
|
3
|
+
description: "Player controllers for 2D and 3D, plus the canonical third-person controller for Summer humanoid packages: movement owns translation, clips follow state."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: [Cursor, Claude Code, Codex, Windsurf, Gemini, OpenCode]
|
|
6
|
+
category: character-controllers
|
|
7
|
+
user-invocable: false
|
|
8
|
+
allowed-tools: Read Grep summer_read_file summer_write_file summer_replace_text summer_get_scene_tree summer_add_node summer_set_prop summer_batch summer_input_map_bind summer_save_scene summer_get_script_errors summer_get_diagnostics summer_play summer_stop
|
|
9
|
+
paths: ["**/*.gd", "**/*.tscn"]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Character Movement
|
|
13
|
+
|
|
14
|
+
The player controller is the first thing you build and the thing the user feels
|
|
15
|
+
in the first 3 seconds. Ship the smallest correct controller, then tune feel.
|
|
16
|
+
|
|
17
|
+
Trigger phrases: "add player movement", "the player can't move / falls through
|
|
18
|
+
the floor", "wire my imported character as the player", "walk/run/jump
|
|
19
|
+
animations", "mouse look", "make the jump feel better".
|
|
20
|
+
|
|
21
|
+
Supporting files live in this skill's `references/` folder, next to this
|
|
22
|
+
SKILL.md. Open only the one the task needs:
|
|
23
|
+
|
|
24
|
+
| File | Read when |
|
|
25
|
+
|------|-----------|
|
|
26
|
+
| `references/default-third-person-controller.gd` | standard playable third-person Summer humanoid package; copy this exact controller instead of rewriting it |
|
|
27
|
+
| `references/default-third-person-verification-probe.gd` | runtime proof for that controller; pass it unchanged as a `RunVerification` `probe_source` |
|
|
28
|
+
| `references/platformer-feel.md` | jump feels bad, coyote time, jump buffering, variable jump height, one-way platforms |
|
|
29
|
+
| `references/movement-3d.md` | FPS/third-person controllers, mouse look, sprint, crouch, spring-arm camera |
|
|
30
|
+
|
|
31
|
+
## Default playable Summer character
|
|
32
|
+
|
|
33
|
+
For a standard playable third-person Summer humanoid package, install this
|
|
34
|
+
skill's `references/default-third-person-controller.gd` unchanged as the player
|
|
35
|
+
script. Do not rewrite or reconstruct it from the snippets below. Customize the
|
|
36
|
+
installed file only when the user explicitly asks for different controls or
|
|
37
|
+
behavior.
|
|
38
|
+
|
|
39
|
+
Install it byte-exact:
|
|
40
|
+
|
|
41
|
+
1. Take the full text of `references/default-third-person-controller.gd` from
|
|
42
|
+
this skill's folder, unchanged (tabs, comments and all).
|
|
43
|
+
2. New destination:
|
|
44
|
+
`summer_write_file(path="res://scripts/player.gd", content=<that text>, create_only=true)`.
|
|
45
|
+
Existing destination: `summer_read_file(path="res://scripts/player.gd")`
|
|
46
|
+
first, then `summer_write_file(path=..., content=<that text>, expected_sha256=<sha256 from the read>)`.
|
|
47
|
+
3. Confirm the copy is exact: the write receipt's sha256 must equal the sha256
|
|
48
|
+
of the source file (hash it locally when you have a shell; otherwise
|
|
49
|
+
`summer_read_file` the result and compare it to the source text).
|
|
50
|
+
|
|
51
|
+
Do not edit the installed file, add roles, or add an `AnimationTree` merely
|
|
52
|
+
because the user selected more package clips: choosing clips is not a request
|
|
53
|
+
to customize controls or behavior. When the user does explicitly request
|
|
54
|
+
different controls or behavior, install the exact canonical source first, then
|
|
55
|
+
`summer_read_file` the installed project file and change it with
|
|
56
|
+
`summer_replace_text`. Configure the manifest path and node paths on the scene
|
|
57
|
+
instance.
|
|
58
|
+
|
|
59
|
+
Required main-scene shape:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
Main (Node3D)
|
|
63
|
+
Player (CharacterBody3D) # template script
|
|
64
|
+
CollisionShape3D # capsule
|
|
65
|
+
CharacterRotationRoot (Node3D) # only this node turns
|
|
66
|
+
Character # imported character.tscn instance
|
|
67
|
+
CameraYaw (Node3D)
|
|
68
|
+
CameraPitch (Node3D)
|
|
69
|
+
SpringArm3D
|
|
70
|
+
Camera3D # current = true
|
|
71
|
+
Ground / level geometry # world siblings of Player
|
|
72
|
+
DirectionalLight3D / WorldEnvironment
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
When authoring a new main scene as `.tscn` text (written whole with
|
|
76
|
+
`summer_write_file`, never a hand edit of a scene open in the editor), use this
|
|
77
|
+
exact serialization pattern. Replace only the imported package paths when they
|
|
78
|
+
differ:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
[gd_scene load_steps=7 format=3]
|
|
82
|
+
|
|
83
|
+
[ext_resource type="Script" path="res://scripts/player.gd" id="1_controller"]
|
|
84
|
+
[ext_resource type="PackedScene" path="res://characters/imported/character.tscn" id="2_character"]
|
|
85
|
+
|
|
86
|
+
[sub_resource type="CapsuleShape3D" id="PlayerCapsule"]
|
|
87
|
+
radius = 0.45
|
|
88
|
+
height = 1.8
|
|
89
|
+
|
|
90
|
+
[sub_resource type="BoxShape3D" id="GroundShape"]
|
|
91
|
+
size = Vector3(20, 0.5, 20)
|
|
92
|
+
|
|
93
|
+
[sub_resource type="BoxMesh" id="GroundMesh"]
|
|
94
|
+
size = Vector3(20, 0.5, 20)
|
|
95
|
+
|
|
96
|
+
[sub_resource type="Environment" id="WorldEnvironment"]
|
|
97
|
+
background_mode = 1
|
|
98
|
+
background_color = Color(0.12, 0.18, 0.3, 1)
|
|
99
|
+
ambient_light_energy = 0.6
|
|
100
|
+
|
|
101
|
+
[node name="Main" type="Node3D"]
|
|
102
|
+
|
|
103
|
+
[node name="Player" type="CharacterBody3D" parent="."]
|
|
104
|
+
position = Vector3(0, 1, 0)
|
|
105
|
+
script = ExtResource("1_controller")
|
|
106
|
+
character_manifest_path = "res://characters/imported/character.json"
|
|
107
|
+
|
|
108
|
+
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player"]
|
|
109
|
+
shape = SubResource("PlayerCapsule")
|
|
110
|
+
|
|
111
|
+
[node name="CharacterRotationRoot" type="Node3D" parent="Player"]
|
|
112
|
+
|
|
113
|
+
[node name="Character" parent="Player/CharacterRotationRoot" instance=ExtResource("2_character")]
|
|
114
|
+
|
|
115
|
+
[node name="CameraYaw" type="Node3D" parent="Player"]
|
|
116
|
+
|
|
117
|
+
[node name="CameraPitch" type="Node3D" parent="Player/CameraYaw"]
|
|
118
|
+
rotation = Vector3(-0.349066, 0, 0)
|
|
119
|
+
|
|
120
|
+
[node name="SpringArm3D" type="SpringArm3D" parent="Player/CameraYaw/CameraPitch"]
|
|
121
|
+
spring_length = 5.0
|
|
122
|
+
|
|
123
|
+
[node name="Camera3D" type="Camera3D" parent="Player/CameraYaw/CameraPitch/SpringArm3D"]
|
|
124
|
+
current = true
|
|
125
|
+
|
|
126
|
+
[node name="Ground" type="StaticBody3D" parent="."]
|
|
127
|
+
position = Vector3(0, -0.25, 0)
|
|
128
|
+
|
|
129
|
+
[node name="MeshInstance3D" type="MeshInstance3D" parent="Ground"]
|
|
130
|
+
mesh = SubResource("GroundMesh")
|
|
131
|
+
|
|
132
|
+
[node name="CollisionShape3D" type="CollisionShape3D" parent="Ground"]
|
|
133
|
+
shape = SubResource("GroundShape")
|
|
134
|
+
|
|
135
|
+
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
|
136
|
+
rotation_degrees = Vector3(-55, -30, 0)
|
|
137
|
+
shadow_enabled = true
|
|
138
|
+
|
|
139
|
+
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
|
140
|
+
environment = SubResource("WorldEnvironment")
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Every nested `parent` is the complete path from the scene root, excluding the
|
|
144
|
+
root node's own name. Never shorten
|
|
145
|
+
`parent="Player/CameraYaw/CameraPitch"` to `parent="CameraPitch"`. A
|
|
146
|
+
`PackedScene` instance belongs in the `[node ...]` header and has no `type`;
|
|
147
|
+
never write a typed `Node3D` followed by `instance = ExtResource(...)` in the
|
|
148
|
+
node body. The playable body is a child of the world root. Ground, level
|
|
149
|
+
geometry, lights, and environment remain siblings of `Player`, never children
|
|
150
|
+
of it, so they do not move with the player.
|
|
151
|
+
|
|
152
|
+
Set `character_manifest_path` to the imported package's `character.json`. Bind
|
|
153
|
+
`move_left`, `move_right`, `move_forward`, `move_back`, `jump`, and `sprint`
|
|
154
|
+
before running, one `summer_input_map_bind` per action (e.g.
|
|
155
|
+
`summer_input_map_bind(name="move_forward", events=[{"type": "key", "key": "W"}])`);
|
|
156
|
+
`ui_cancel` is a built-in action — confirm it is still bound. The controller
|
|
157
|
+
asserts every one of them at `_ready`. Do not attach this template during generic import or
|
|
158
|
+
to an NPC unless the user explicitly asks for player-style control.
|
|
159
|
+
|
|
160
|
+
The default camera has horizontal mouse orbit only. `CameraPitch` is set once to
|
|
161
|
+
a modest downward angle and vertical mouse motion does not change it. The
|
|
162
|
+
controller keeps a short floor snap plus a small downward grounded velocity so
|
|
163
|
+
ordinary horizontal movement does not create a false airborne `Jump` state. It
|
|
164
|
+
also records the spawn point and respawns after falling below `respawn_below_y`.
|
|
165
|
+
|
|
166
|
+
A bind T/A-pose survives every static check: the AnimationPlayer is wired, the
|
|
167
|
+
clip is named `Idle`, and the files on disk all read correctly. Only a running
|
|
168
|
+
frame separates that from a character actually at rest.
|
|
169
|
+
|
|
170
|
+
**Runtime proof.** Read this skill's
|
|
171
|
+
`references/default-third-person-verification-probe.gd` and pass its full text
|
|
172
|
+
unchanged as the `probe_source` of a `RunVerification` op, which runs it in a
|
|
173
|
+
hidden, disposable game instance that never touches the editor:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
summer_batch(ops=[{"op": "RunVerification", "max_seconds": 30, "probe_source": "<the probe file, unchanged>"}])
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The probe samples the live Skeleton3D after
|
|
180
|
+
the player reaches the floor, requires the real resting clip to be named `Idle`,
|
|
181
|
+
verifies that its pose actually changes, rejects an idle whose hands remain level
|
|
182
|
+
with the upper arms like a bind T/A-pose, saves separate idle and moving frames,
|
|
183
|
+
verifies W moves toward world `-Z`, and verifies vertical mouse input leaves
|
|
184
|
+
camera pitch unchanged. Every boolean in `results` must be `true`; open the saved
|
|
185
|
+
idle and moving frames listed in `frames` before you describe them. A `false` is
|
|
186
|
+
a finding to fix, not a flaky probe.
|
|
187
|
+
|
|
188
|
+
**If the probe cannot run** (the op returns `ok: false` with a `failure_reason`
|
|
189
|
+
such as `spawn_failed`, or the engine build lacks the op), the runtime question
|
|
190
|
+
belongs to the user. Do not paste the probe into the project. Finish on the
|
|
191
|
+
saved state: the manifest path written into the
|
|
192
|
+
Player node, the four semantic roles present, CameraYaw at identity and
|
|
193
|
+
CameraPitch at its fixed angle in the `.tscn` text, the InputMap actions bound,
|
|
194
|
+
and clean diagnostics. Then tell the user which idle clip should be playing at
|
|
195
|
+
rest, so it is the first thing they look at on Play. That is a complete
|
|
196
|
+
integration handed off for a playtest, not an incomplete one.
|
|
197
|
+
|
|
198
|
+
## Order of operations
|
|
199
|
+
|
|
200
|
+
1. Root node must be `CharacterBody2D` or `CharacterBody3D`. `move_and_slide()`
|
|
201
|
+
only exists on these. RigidBody is for physics props, not players.
|
|
202
|
+
2. Give it a `CollisionShape2D/3D` with a real shape (CapsuleShape for 3D humans,
|
|
203
|
+
RectangleShape/CapsuleShape2D for 2D). No shape = falls through everything.
|
|
204
|
+
3. Read gravity from project settings, never hardcode it, so tuning one value
|
|
205
|
+
fixes the whole game: `ProjectSettings.get_setting("physics/2d/default_gravity")`.
|
|
206
|
+
4. Bind input actions BEFORE the script references them (`move_left`, `jump`, ...).
|
|
207
|
+
Referencing an unbound action is a silent no-op that reads as "controls dead".
|
|
208
|
+
5. Compile-check, then run and watch it move. Feel is a user call, not a still frame.
|
|
209
|
+
|
|
210
|
+
## 2D side-scroller controller (the 40% every 2D game shares)
|
|
211
|
+
|
|
212
|
+
```gdscript
|
|
213
|
+
extends CharacterBody2D
|
|
214
|
+
|
|
215
|
+
@export var speed: float = 200.0
|
|
216
|
+
@export var jump_velocity: float = -350.0 # negative = up in 2D
|
|
217
|
+
|
|
218
|
+
var gravity: float = ProjectSettings.get_setting("physics/2d/default_gravity")
|
|
219
|
+
|
|
220
|
+
func _physics_process(delta: float) -> void:
|
|
221
|
+
if not is_on_floor():
|
|
222
|
+
velocity.y += gravity * delta
|
|
223
|
+
if Input.is_action_just_pressed("jump") and is_on_floor():
|
|
224
|
+
velocity.y = jump_velocity
|
|
225
|
+
var dir := Input.get_axis("move_left", "move_right")
|
|
226
|
+
velocity.x = dir * speed if dir else move_toward(velocity.x, 0.0, speed)
|
|
227
|
+
move_and_slide()
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Flip the sprite with `$Sprite2D.flip_h = velocity.x < 0` only when `velocity.x != 0`.
|
|
231
|
+
For real platformer feel (coyote time, jump buffer, variable height) load
|
|
232
|
+
`references/platformer-feel.md`.
|
|
233
|
+
|
|
234
|
+
## Top-down controller (RPG / twin-stick / survivors)
|
|
235
|
+
|
|
236
|
+
No gravity. 8-directional, normalize so diagonals are not faster.
|
|
237
|
+
|
|
238
|
+
```gdscript
|
|
239
|
+
extends CharacterBody2D
|
|
240
|
+
|
|
241
|
+
@export var speed: float = 220.0
|
|
242
|
+
|
|
243
|
+
func _physics_process(_delta: float) -> void:
|
|
244
|
+
var dir := Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
|
245
|
+
velocity = dir * speed
|
|
246
|
+
move_and_slide()
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Survivors-style games with 200+ agents: enemies are `Area2D` moved with
|
|
250
|
+
`position += dir * speed * delta`, NOT physics bodies. See the `make-game`
|
|
251
|
+
skill's `../make-game/references/2d-survivors.md`. The PLAYER stays a CharacterBody2D.
|
|
252
|
+
|
|
253
|
+
## 3D controller (first + third person)
|
|
254
|
+
|
|
255
|
+
Both share the same body + gravity + `Input.get_vector` floor logic. The only
|
|
256
|
+
difference is where the camera lives and how look rotation is applied. Full
|
|
257
|
+
first-person and third-person controllers, mouse look, sprint, crouch, and
|
|
258
|
+
spring-arm setup are in `references/movement-3d.md` - load it for any 3D player.
|
|
259
|
+
|
|
260
|
+
Minimal 3D walk (no look yet):
|
|
261
|
+
|
|
262
|
+
```gdscript
|
|
263
|
+
extends CharacterBody3D
|
|
264
|
+
|
|
265
|
+
@export var speed: float = 5.0
|
|
266
|
+
@export var jump_velocity: float = 4.5
|
|
267
|
+
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
|
268
|
+
|
|
269
|
+
func _physics_process(delta: float) -> void:
|
|
270
|
+
if not is_on_floor():
|
|
271
|
+
velocity.y -= gravity * delta
|
|
272
|
+
if Input.is_action_just_pressed("jump") and is_on_floor():
|
|
273
|
+
velocity.y = jump_velocity
|
|
274
|
+
var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
|
|
275
|
+
var direction := (transform.basis * Vector3(input_dir.x, 0.0, input_dir.y)).normalized()
|
|
276
|
+
if direction:
|
|
277
|
+
velocity.x = direction.x * speed
|
|
278
|
+
velocity.z = direction.z * speed
|
|
279
|
+
else:
|
|
280
|
+
velocity.x = move_toward(velocity.x, 0.0, speed)
|
|
281
|
+
velocity.z = move_toward(velocity.z, 0.0, speed)
|
|
282
|
+
move_and_slide()
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Summer humanoid package
|
|
286
|
+
|
|
287
|
+
When the player visual is a Summer character package:
|
|
288
|
+
|
|
289
|
+
1. Produce or import the package first — it comes from the shared character
|
|
290
|
+
pipeline (`character-model`; `summer_generate_3d` with rigging and animations)
|
|
291
|
+
and carries `character.tscn` plus its `character.json` manifest. Instantiate
|
|
292
|
+
`character.tscn`; for clip wiring without this controller see
|
|
293
|
+
`character-animation-wiring`.
|
|
294
|
+
2. Put the normalized wrapper under a `CharacterBody3D`; do not modify the package or
|
|
295
|
+
scale the body.
|
|
296
|
+
3. Let controller velocity and `move_and_slide()` own all scene translation. Idle, Walk,
|
|
297
|
+
Run, and Jump are in-place visual clips; never add their root motion to velocity.
|
|
298
|
+
4. Resolve the four clips from `character.json` semantic roles instead of guessing names.
|
|
299
|
+
Require every requested role; never substitute one role for another.
|
|
300
|
+
5. Select one state from physics: airborne -> Jump, stopped -> Idle, moving -> Walk,
|
|
301
|
+
sprinting -> Run. Airborne Jump has highest priority and never falls back to Walk/Run.
|
|
302
|
+
Change clips only when the state changes, so Jump plays once per takeoff.
|
|
303
|
+
6. Rotate the visual child toward non-zero movement while preserving the normalized
|
|
304
|
+
`-Z` forward axis. Turn only visual yaw; do not rotate the collision body merely to
|
|
305
|
+
turn the mesh. Keep the third-person camera behind the visual on local `+Z`.
|
|
306
|
+
|
|
307
|
+
Do not put player controls into the generation pipeline or generic character importer.
|
|
308
|
+
|
|
309
|
+
## Camera-follow basics
|
|
310
|
+
|
|
311
|
+
- 2D: add a `Camera2D` as a CHILD of the player (it is active while `enabled`,
|
|
312
|
+
the default), `position_smoothing_enabled = true`, speed 5-8. Add
|
|
313
|
+
`limit_left/right/top/bottom` so it never shows past the level edge. Full rigs
|
|
314
|
+
in the `camera-rigs` skill.
|
|
315
|
+
- 3D first-person: camera is a child of a `Head` node; yaw rotates the body,
|
|
316
|
+
pitch rotates the Head (never the body) to avoid gimbal lock.
|
|
317
|
+
- 3D third-person: camera on a `SpringArm3D` so walls push it in. See `camera-rigs`.
|
|
318
|
+
|
|
319
|
+
## Traps
|
|
320
|
+
|
|
321
|
+
- Scaling the CharacterBody node breaks collision + velocity. Scale the MESH/Sprite
|
|
322
|
+
child instead. In 3D, 1 unit = 1 meter; a human is ~1.0-2.0 tall.
|
|
323
|
+
- `is_on_floor()` is only valid AFTER `move_and_slide()` ran once this frame.
|
|
324
|
+
- Diagonal speed-up = you forgot to normalize the input vector.
|
|
325
|
+
- Mouse captured with no release traps the user. Always pair
|
|
326
|
+
`Input.MOUSE_MODE_CAPTURED` with a `ui_cancel` handler that sets it VISIBLE.
|