Simple
Scene: DuckShooter_Simple
The simplest scene, showing 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 50, so a duck takes two 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 DeathEffect to remove itself after 2 seconds.
Tip
Start here to see every piece of the system working together, then open the other scenes for the advanced setups.