5 minutes
Recycle the Rounds and Pause on Death
Every pool you've built shares one behavior. The Bullets pool has 256 slots; hold the trigger and they fill. With nothing to retire a round on its own, the pool can only make room by force — it reuses its oldest slots, even rounds still in flight, so a tracer blinks out early, before its time ran out, because the pool needed the slot back. Debris and missiles churn the same way. The fix is a clock on every pooled slot: a Lifetime that counts a round down and hands it back to the pool on time. And there's a second countdown this lesson — the one destroyShip starts when a critical hit finally kills you, freezing the ship dead and then, as you'll see, doing nothing at all with the clock it just wound.
One clock rides the blueprints, one shows up on death
These two countdowns share a shape — a single remaining — but they live in opposite places, and that split is the lesson.
Open SpaceshooterFlight2/scene.json and search for Lifetime. You get three hits, one on each pool blueprint: Bullets, Missiles, Debris. The recycle clock isn't buried in setup code. It's a plain component sitting on each blueprint, right next to the round's Renderable and Velocity6DOF:
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.