Hole Game

v0.3-suction

Continuous-sink absorption · Cubes sink continuously based on overlap depth, not a fixed 0.25 s timer. Drive-by absorption works — no need to stop. Once a cube has started sinking, it commits and finishes even if the hole moves on.

Build notes

Why this exists

  • Previous absorption: when a cube's collider entered the hole's trigger, an AbsorbInto coroutine ran for a fixed 0.25 s — lerping the cube to a captured target then destroying it.
  • Two failures: (a) drive-by didn't work — moving the hole over a cube briefly started the coroutine, but then the hole left the trigger volume and the cube popped back to its original position. (b) The captured target was where the hole *was* at trigger entry, so cubes fell into where the hole used to be.

What changed

  • Replaced trigger callbacks with a per-frame position check inside AbsorbableObject.Update. Each frame, iterate PrototypeGameManager.Instance.Actors, find the eligible hole with the deepest XZ overlap, sink toward it.
  • Sink rate scales with overlap depth: baseSinkSpeed (2) + depthSinkSpeed (5) * depth. Pull rate (XZ): basePullSpeed (4) + depthPullSpeed (6) * depth. Deeper overlap = faster consumption.
  • Target the hole's *current* position each frame, not the captured-at-entry position. Fixes the 'cube fell into where the hole was' bug.

Commit lock

  • First attempt at drive-by absorption broke because cubes that sank below the hole's SphereCollider triggered OnTriggerExit, which made the script think 'no overlapping hole' and start recovering.
  • Fixed by switching to position-based eligibility (cube center inside hole's XZ radius) instead of trigger callbacks.
  • Plus a commit lock: once a cube has descended 0.08 units past its starting Y, it remembers which hole it's sinking toward and finishes the sink even if the hole moves out of the cube's footprint.

Wobble preserved

  • Cube's requiredHoleRadius exceeds the hole's current radius → cube wobbles once on entry, doesn't sink. Same as before.
  • Wobble is one-shot, re-armed only after the cube fully exits all hole footprints.