Lesson 7 gave guards honest investigate and search loops. This lesson gives the player something to throw and something to jam so those loops activate on your schedule—not only on ambient bumps. You will keep scope tight: one noise distraction and one short disable that plugs into perception and Blackboard keys you already own.

Lesson objective
By the end of this lesson you will have:
- A player-triggered noise event (throwable or placed decoy) that AI hears using the same AI Perception hearing config from Lesson 5.
- A temporary disable (stun pad, EMP puff, or door jammer) that flips a Blackboard bool or GameplayTag so guards pause patrol or lose sight for a bounded time.
- Cooldown and ammo rules so gadgets cannot spam Investigate forever or trivialise Lesson 7’s search windows.
Step 1: Pick two gadgets only
| Gadget | Player fantasy | AI stress test |
|---|---|---|
| Distraction | “I pull them left so I slip right.” | Hearing + StimulusLocation accuracy |
| Disable | “I buy three seconds at this door.” | Blackboard gating on patrol / engage |
If your Lesson 1 pillar forbids lethality, both stay non-damaging. If combat is allowed later, do not hook damage here—prove utility first.
Step 2: Distraction—spawn or trace, then report noise
Blueprint-friendly path:
- Input action (or UI button for prototype) spawns a small Actor
BP_NoiseDecoyat socket or trace hit location with NavMesh validation (Project Point to Navigation). - On spawn (or after a short fuse), call
Report Noise Eventtargeting the AI Perception system: location = decoy world position, loudness = tuned scalar (start low, increase until guards react at intended range). - Destroy or mute the decoy after one pulse so old props do not keep re-alerting.
Pro tip: log DecoyID and timestamp to the Output Log when you fire noise; when two guards stack on one corner, you will see duplicate reactions instantly.
Step 3: Wire perception to Lesson 6–7 trees
Confirm Hearing sense on AIPerceptionComponent still raises On Perception Updated to your AI Controller or pawn that writes Blackboard:
- Copy stimulus location into
StimulusLocation(or your named key). - Bump AlertLevel / set bHeardDistraction so Investigate wins over Patrol per Lesson 6 priority stack.
Common mistake: noise fires under the floor or inside geometry—perception resolves a bogus point and guards path fail. Always offset Z by 10–30 units after trace placement.
Step 4: Temporary disable—time-gated Blackboard
Implement BP_Gadget_DisableZone (overlap volume) or line-trace deploy that:
- On successful hit on guard capsule, set
bGadgetDisabled(bool) true on that pawn’s Blackboard. - Start a timer (3–5 seconds for slice) that clears the flag.
- In the Behavior Tree, wrap Move To / Rotate / Engage tasks with a Decorator: Blackboard Based Condition
bGadgetDisabledIs Not Set (or inverted logic you prefer).
Guards should hold position, play stunned idle, or drop to Calm—pick one readable pose so playtesters read the effect.
Step 5: Cooldowns and fairness
Add to player (Component or BP_PlayerStealth):
DistractionCharges(int) orDistractionCooldown(float).DisableCooldownseparate from distraction—prevents one-button stunlock chains.
On AI side, reuse Lesson 7’s cooldown idea: after investigating a noise class stimulus, ignore duplicate noise from the same tag for X seconds so players cannot ping-pong one guard.
Step 6: Playtest trio
- Pure distraction—cross a line while two guards both Investigate the decoy; verify no instant snap back without Search rules.
- Disable during Engaged—confirm your decorator does not leave guards frozen forever if the player dies mid-effect (clear flag On End Play / Possessed change).
- NavMesh failure—throw decoy off ledge; guard should fail gracefully (abort Move To, return to Patrol) rather than T-pose slide.
Mini challenge
- Add a secondary noise profile (“soft toss” vs “loud clank”) with two loudness values and document which radius each pulls on your greybox.
- Force yourself to complete the mission using at most two distractions and one disable—note every unfair edge case in a scratch QA list.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| No reaction to decoy | Hearing sense off or wrong team | Check Affiliation / Sense Config |
| Everyone on map aggro | Loudness too high or global bus | Reduce loudness; verify one-shot event |
| Disable does nothing | Decorator on wrong subtree | Apply to all locomotion branches |
| Guard stuck after disable | Timer not clearing on death | Bind cleanup to EndPlay / Unpossess |
| Decoy spawns inside player | Trace starts inside capsule | Start trace forward of camera / mesh |
Summary
- Gadgets are inputs to the same perception and Blackboard contracts you already built.
- One noise path and one timed flag beat a bag of half-wired tools.
- Cooldowns on both sides keep stealth readable and speedrun-resistant.
Further reading
- AI and Behavior Trees in Unreal – decorators and Blackboard conditions you will gate with
bGadgetDisabled. - UE 5.5 packaging help – when gadget Blueprints pull unexpected dependencies into builds.
FAQ
Should distractions use physical projectiles?
Optional. A line trace + spawn is enough for the slice; add arc mesh when presentation matters.
Can I stun multiple guards at once?
Yes, but cap the overlap count or scale disable duration down per extra guard so rooms do not become trivial.
Multiplayer later?
Run noise and disable server-authoritative; replicate cosmetic props to clients.
Continue to Lesson 9: Objective and Checkpoint Flow to tie primary goals, fail-forward checkpoints, and mission flow to the stealth loop you can now shape with tools. Bookmark this lesson once your first successful distraction pull shows up in a screen recording you would ship in a portfolio cut.