Guide 4 — Missile Man!
Zachary Thompson
What you're building
Criminals have overrun the city and the hero they got is a coward. Missile Man is incredibly powerful, ridiculously durable, and refuses to stand toe-to-toe with anybody. He won't punch. He won't grapple. His entire fighting technique is run really fast and throw himself at people.
Mechanically: you build speed by running, a charge meter fills, and when it's full enough you launch yourself as a human projectile. Damage scales with how much charge you had.
Yours is the first guide with combat, so you'll meet the hitbox/hurtbox system that four other games use. The launch itself is one component and mostly Inspector tuning.
Time: about two and a half hours.
1. Before you start
- Finish Guide 0.
- Read Guide B §B1 (player prefab) and §B4 (enemy prefab) — you'll build both.
- No extra packages, no new input actions. The launch uses the existing
Attackaction.
2. Scripts you'll use
Core — Guide B §B1 and §B2
PlayerController2D · PlayerAnimatorBridge · Health · DamageOnContact · Checkpoint · RespawnManager · CameraTargetAssigner · SceneLoader · GameManager · AudioManager · HUDController · ParallaxBackground
Combat (Tier 2)
Team · Hurtbox · Hitbox · Knockback · EnemyChase · BossController · BossArenaTrigger
Movement (Tier 3)
Sprint · MomentumLauncher
You will not need: MeleeAttack — Missile Man doesn't punch, and that's the joke. Don't add it.
3. Understand hitboxes before you build anything
Five minutes here saves an hour later.
Hurtbox = where I can be hit.
Hitbox = what hurts you.
Both are child objects with trigger colliders. Keeping them separate from the body collider means you can make the hurtbox smaller than the sprite (fairer) and turn a hitbox on only during an attack.
Each one has a Team: Player, Enemy, or Neutral. A hitbox only damages hurtboxes on a different team, which is why your launch can't hurt you and thugs can't hurt each other.
The setup tool already made the Hitbox and Hurtbox layers collide only with each other. That stops attack boxes snagging on walls. Put your hitbox and hurtbox children on those layers or you'll get strange behaviour.
4. Build Missile Man
Follow Guide B §B1, with these values:
| Component | Setting | Value |
|---|---|---|
Health | Max Health | 5 |
| Invulnerability Time | 1 | |
PlayerController2D | Move Speed | 9 |
| Acceleration | 35 — deliberately slow to reach top speed | |
| Deceleration | 60 |
Acceleration 35 is a design choice. Missile Man has to build momentum, so reaching top speed should take a moment. If he hits full speed instantly there's no anticipation before the launch.
Then add:
| Component | Settings |
|---|---|
| Knockback | Stun Duration 0.25 · Resistance 0 |
| Sprint | Sprint Multiplier 1.6 · Toggle Mode ✗ · Stamina Seconds 0 |
| MomentumLauncher | section 5 |
The two children
Hurtbox — right-click Player → Create Empty:
- Box Collider 2D, Is Trigger ✓, slightly smaller than the sprite
- Hurtbox component, Team = Player
- Object Layer →
Hurtbox
LaunchHitbox — right-click Player → Create Empty:
- Box Collider 2D, Is Trigger ✓, roughly the size of his body
- Hitbox component:
| Field | Value |
|---|---|
| Target Team | Enemy |
| Damage | 1 (overwritten at runtime by charge) |
| Knockback Force | 18 |
| Knockback Upward | 8 |
| Repeat Delay | 0 |
- Object Layer →
Hitbox - Untick the GameObject checkbox at the top of the Inspector so it starts disabled
The knockback numbers are absurdly high on purpose. Your game is a comedy — thugs should sail off the screen. Turn them up further if it isn't funny yet.
5. Set up the launch
On Player, fill in MomentumLauncher:
| Field | Value | What it does |
|---|---|---|
| Charge Rate | 1.5 | seconds of running to reach full charge |
| Speed Fraction To Charge | 0.8 | you must be at 80% of top speed to build charge |
| Charge Decay Rate | 1 | how fast charge bleeds away when you stop |
| Min Charge To Launch | 0.3 | you can launch weakly after a short run |
| Launch Speed Min | 15 | |
| Launch Speed Max | 30 | at full charge |
| Launch Duration | 0.5 | |
| Invulnerable While Launching | ✓ | |
| Max Damage | 5 | at full charge; min charge does 1 |
| Launch Hitbox | drag LaunchHitbox in | |
| Wall Layer | Ground | the launch stops on impact |
| Wall Check Distance | 0.5 | |
| Wall Impact Self Damage | 0 | see below |
Two decisions worth making deliberately
Wall Impact Self Damage. At 0, hitting a wall just stops you. Set it to 1 and Missile Man hurts himself on impact — funnier, and it means aiming badly has a cost. Your call, but the character is "ridiculously durable," so 0 fits the fiction and 1 fits the comedy. Try both.
Speed Fraction To Charge. At 0.8 you must be near top speed. Lower it to 0.5 and charge builds almost as soon as you move, which makes the game faster but removes the run-up. The run-up is the character. Keep it high.
6. Build a thug
Follow Guide B §B4, then adjust:
| Component | Setting | Value |
|---|---|---|
Health | Max Health | 2 · Destroy On Death ✓ · Invulnerability 0 |
Knockback | Resistance | 0 — you want them to fly |
EnemyChase | Detect Radius | 8 |
| Lose Radius | 12 | |
| Chase Speed | 3 | |
| Movement | Grounded | |
| Attack Range | 1.2 | |
| Attack Cooldown | 1.5 | |
| Stop In Range | ✓ |
Children:
Hurtbox— trigger collider, Hurtbox (Team = Enemy), layerHurtboxBodyHitbox— trigger collider, Hitbox (Target Team = Player, Damage 1, Repeat Delay 1), layerHitbox, left enabled
The thug damages you by touching you. Since Missile Man never punches, contact damage is all the threat you need.
Make two or three variants — a fast weak one, a slow tough one — by changing Health, Chase Speed, and the sprite. Save each as a prefab.
7. Build the supervillain boss
BossController builds a boss out of the pieces you already have, using UnityEvents. No new code.
- Empty GameObject
Boss, tagEnemy, sprite, Rigidbody2D, collider. - Add:
- Health — Max Health 25 · Invulnerability 0 · Destroy On Death ✗
- Knockback — Resistance 1 (the boss doesn't fly across the room)
- BossController
- Children:
Hurtbox(Team Enemy) and one or more attack hitboxes, disabled.
Wiring the phases
In BossController, set Start Automatically ✗ and add two Phases:
Phase 1 — Health Percent 100 · Rest Between Attacks 1.5
| Attack | Duration | On Execute |
|---|---|---|
Charge | 1.2 | your charge hitbox → GameObject.SetActive ✓ |
ChargeEnd | 0.1 | same hitbox → GameObject.SetActive ✗ |
Taunt | 1.0 | AudioManager.PlaySFX → boss_taunt |
Phase 2 — Health Percent 50 · Rest Between Attacks 0.8
Same attacks with higher weights, plus anything extra. Shorter rest is the simplest way to make phase two feel dangerous.
- Add a
BossArenaTriggerat the room entrance: trigger collider, drag theBossin, and put your arena doors in the Barriers list.
Attacks come in on/off pairs. One entry turns a hitbox on, the next turns it off. It looks odd in the Inspector but it means you can build any attack pattern without writing code.
8. The HUD — the charge meter
The charge meter is not optional. A charge mechanic the player can't see is a guessing game.
- GameObject → UI → Canvas.
- Right-click Canvas → UI → Slider, name it
ChargeBar. Put it near the bottom-centre, under where the character sits.- Delete the Handle Slide Area child
- Interactable ✗
- Min Value 0, Max Value 1
- Colour the Fill something hot — orange or red
- Add a row of hearts or a health Slider for health (Guide B §B6 style).
- Empty child
HUDwith HUDController; drag your health bar in.
Make the meter readable
Two cheap upgrades worth doing:
- Put a visible mark at 0.3 (your Min Charge To Launch) so the player can see when a launch becomes possible — a thin vertical line Image does it.
- Wire
OnChargeChangedto change the bar's colour at full, or add particles to Missile Man while fully charged. The player should feel loaded.
9. Wire it up
| On this object | Event | Drag in | Choose |
|---|---|---|---|
Player → Health | On Died | RespawnManager | RespawnManager.OnPlayerDied |
Player → Health | On Health Changed | HUD | HUDController.UpdateHealth (Dynamic) |
Player → MomentumLauncher | On Charge Changed | ChargeBar | Slider.value (Dynamic float) |
Player → MomentumLauncher | On Launched | AudioManager | AudioManager.PlaySFX (string) → launch |
Player → PlayerController2D | On Jumped | AudioManager | PlaySFX (string) → jump |
| Thug → EnemyChase | On Attack | (leave empty) | contact damage handles it |
Boss → BossController | On Boss Defeated | GameManager | GameManager.LevelComplete |
Row 3 is the important one. Pick Dynamic float — the static version lets you type a fixed number, which will pin your bar at one value forever.
10. First playtest
Build a flat strip with three thugs on it.
- Run and jump.
- Hold Sprint and the charge bar fills — but only once you're near top speed. If it fills while walking, Speed Fraction To Charge is too low.
- The bar empties when you stop.
- Press Attack with a full bar and you launch in your facing direction.
- You pass through thugs and they go flying. If you pass through with no effect: is
LaunchHitboxassigned? Are the layers right? Does the thug have aHurtboxwith Team = Enemy? - A weak launch does less damage than a full one. Launch at 0.3 charge against a 2-health thug — it should survive.
- You're invulnerable mid-launch — launch straight into a thug and don't take a hit.
- The launch stops at a wall.
If step 5 fails, the checklist is always: hitbox assigned → teams opposite → both on the right layers → hurtbox exists on the target.
11. Then add
- More thug variants and a street layout. Your game is arenas of enemies, so this is the bulk of the work.
- The boss fight once the basic loop is fun.
- Animation — Guide B §B6, plus a
Launchtrigger. A wind-up pose while charging sells the whole character. - Sound: a rising whine while charging, a bang on launch, comedy impacts.
ParallaxBackground— a city skyline at Depth 0.2.Checkpoints between arenas.
12. Design notes for your game specifically
The comedy is in the commitment. Once Missile Man launches, he cannot steer, cannot stop, and cannot change his mind. That's what makes it funny and what makes it a real decision. Don't add mid-air steering — it would make him better at his job and worse as a character.
Make the wind-up visible. The run-up is the setup and the launch is the punchline. Anything that makes the charging phase readable — a pose, a sound, sparks, screen shake at full charge — pays off double.
Enemies should be flimsy. The fantasy is bowling. Two health and huge knockback means a good launch clears a group, which is exactly the feeling you're after. If thugs survive being hit by a human missile, the joke deflates.
A boss that can't be knocked back is the right kind of wall. Setting Resistance to 1 means the boss doesn't sail away, so the fight becomes about timing your launches rather than spamming them. That contrast is what makes the boss feel like a boss.
13. Common problems
| What you see | What's wrong |
|---|---|
| Charge bar never fills | Speed Fraction To Charge too high, or you're not actually reaching that speed — lower it to 0.6 and retest |
| Charge bar stuck at one value | Wired to static value instead of Dynamic float |
| Launch does nothing | Charge below Min Charge To Launch, or MovementLocked from another script |
| Pass through enemies harmlessly | LaunchHitbox not assigned, or teams the same, or the enemy has no Hurtbox |
| Launch hitbox hits walls | Hitbox child isn't on the Hitbox layer |
| Enemies don't fly | Knockback missing on the enemy, or Resistance is 1 |
| Take damage mid-launch | Invulnerable While Launching unticked |
| Launch never stops | Wall Layer not set to Ground |
| Boss does nothing | Start Automatically ✗ and no BossArenaTrigger, or phases have no attacks |
| Boss attack never turns off | You added the "on" entry but not the matching "off" entry |