# 8. 2D Capstone Pitfalls Part of [[2D Platformer Capstone]]. Prev: [[7. 2D Capstone Camera HUD Build and Rubric]]. | Symptom | Likely cause | Fix | |---|---|---| | Gems, shrines or spikes never react | Zone not on a layer in `PlayerSensor2D.sensorMask`, or its collider is not **Is Trigger** | Check layer and trigger; the sensor ignores solid colliders on purpose | | Zone fires again and again | Zone script on a child **and** a parent (found twice) or `ResetContacts` every frame | One `IPlayerTrigger2D` per zone; reset only after teleports | | Player bounces between spikes and "safe ground" forever | Safe ground recorded next to a hazard | Raise `safeProbeRadius`; never place a landing within one tile of spikes | | Pit does not kill while blinking | Used `TakeDamage` for pits | Pits use `HazardMode.Kill` (calls `PlayerHealth2D.Kill`) | | Crumble ledge reappears inside the player | No occupancy check | `CrumblePlatform2D` waits until the volume is empty | | Door opened but the player still bumps into it | Composite collider not regenerated yet, or door tiles also painted on `Ground` | Paint door tiles only on the `Door` tilemap; wait one physics step | | Player falls through the floor after respawn | Spawn point inside ground, or Teleport did not set `_rb.position` | Put `SpawnPoint` half a tile above the floor; use the controller's `Teleport` | | Camera sweeps across the level on respawn | No warp notification | `CinemachineCore.OnTargetObjectWarped` in `RespawnService2D.Warp` | | Camera shows outside the level | Confiner shape missing or not baked | Assign Bounding Shape 2D; call `InvalidateBoundingShapeCache` after editing it | | Second Global Light 2D ignored or doubles brightness | More than one global light per blend style and sorting layer | One Global light; change its intensity with `DepthDarkness2D` | | Hazards invisible in the dark | Lighting pass hid gameplay | Rim lights on spikes, test at 0% fuel | | Game frozen when entering Play mode | `Time.timeScale` left at 0 by a previous session | `GameFlow2D.OnDestroy` resets it; also check other scripts | | Gem count wrong | Duplicate ids, or gems disabled at start not counted | Unique ids; `FindObjectsByType(FindObjectsInactive.Include)` | | Save never updates | `CapstoneSave2D` missing from the scene or the path not writable | Add it to `Systems`; read the console error | | Animator stuck in Jump | Grounded flicker on slopes or a missing Fall/Land transition | Check `Grounded` in the Inspector; add transitions without exit time | | Knockback launches into a wall and sticks | Wall contact zeroes x velocity | Expected; add invulnerability and smaller x knockback near walls | ## Design pitfalls - **Darkness as punishment.** If running out of fuel kills, players stop exploring. Keep empty fuel survivable and use it as pressure. - **Key behind the door.** Always test that the key can be reached from the side of the gate where the player arrives ([[3. Lock-and-Key Data]]). - **Teach beats with death.** A new mechanic's first appearance should be over safe ground ([[Level Up! (Review)]], Level 9). - **Gems on the critical path only.** Put at least one gem per section off the path, or they are not a mastery goal. ## Sources - See the Sources sections of parts 2-7.