Many Ducks
Scene: DuckShooter_ManyDucks
The full health flow from a hit to a respawn. Waves of ducks fly in, you shoot them, and they shoot soap back at you.
flowchart LR
A[Projectile] --> B[Hitbox] --> C[Health] --> D[On Death]
A bullet deals 25, so a duck takes four hits. A soap deals 100, so one hit destroys the ship, unless it’s still invincible from spawning.
π The Player Ship: DS_Player
| Component | Setup |
|---|---|
Health | 100, Destroy On Death off |
Hitbox | On the root collider, multiplier 1 |
Invincibility | Turned on by the intro animation for 3 seconds after spawning |
SpawnableEffect | Spawns DS_ShipExplosion from On Death |
DSGameManager listens to On Death, hides the ship, then brings it back after 2 seconds with ResetHealth().
π¦ The Ducks: DS_Duck
| Component | Setup |
|---|---|
Health | 100 on the root, Destroy On Death on |
Hitbox | On the duck model’s mesh collider, multiplier 1 |
Hitpoint | Shows the damage, from the hitbox’s On Hit |
SpawnableEffect | Spawns DS_DuckDeathEffect from On Death |
The death effect uses a SoundGenerator for a random squeak and a SelfDestruct to remove itself after 2 seconds.
Tip
Open this scene to see every piece of the system working together in a small game, then the other scenes for the advanced setups.