Unreal Engine 5 Enemy AI #4 – Build a Distraction System with Noise & AI Hearing

Unreal Engine 5 Enemy AI #4 – Build a Distraction System with Noise & AI Hearing

Part 4 of the UE5 Enemy AI Series. Learn to build a distraction system with throwable objects, sound cues, and AI hearing perception—all in Blueprints.

Welcome back! In Part 4 of the Unreal Engine 5 Enemy AI Series, we’re stepping into stealth gameplay.
Up until now:

Now, we’ll go further by building a complete distraction system: throwable objects that make noise, proper 3D audio cues, and AI guards that can hear, investigate, and forget if nothing is found.

All of this is done 100% in Blueprints, no C++ needed.


🎯 What You’ll Learn


📝 Chapters


⚙️ Step 1: Create a Throwable Object (Mesh)

  1. In Content Drawer, create a new folder → 3DModels.
  2. Switch to Modeling Mode (Shift+5).
  3. Under Sphere Tool, set:
    • Radius = 10
    • Accept to save mesh directly in 3DModels folder.
  4. Rename mesh to MySphere.
  5. Double-click to open Static Mesh EditorCollision → Add Sphere Simplified Collision.

👉 This ensures it interacts with physics & overlaps properly.


⚙️ Step 2: Input Action for Throw

  1. In Input/Actions folder → Create Input Action: IA_Throw.
  2. Open it → Value Type = Digital Bool.
  3. In Input Mapping Context (IMC_Default) → Add Mapping:
    • Action: IA_Throw
    • Key: Q (or any key of choice).

👉 Now the project recognizes a “throw” command.


⚙️ Step 3: 3D Audio Setup

  1. Create new folder → Audio.
  2. Import sound file (.wav or .ogg, not .mp3).
  3. Right-click → Create CueBallDrop_Cue.
  4. Open cue:
    • Enable Override Attenuation
    • Set Inner Radius + Falloff Distance for realistic fade
    • Adjust Volume if needed

👉 With attenuation on, sound will only be heard near the impact, not globally.


⚙️ Step 4: Create Blueprint – BP_Throwable

  1. In Blueprints folder → New Actor Blueprint → name BP_Throwable.
  2. Add Components:
    • Static Mesh → assign MySphere
    • Projectile Movement
  3. Static Mesh settings:
    • Collision = Block All
    • Simulate Physics = OFF
    • Enable Gravity = ON
  4. Projectile Movement:
    • Initial Speed = 1000
    • Max Speed = 10000
    • Should Bounce = ON
    • Disable “Initial Velocity in Local Space”

👉 Ball now behaves like a proper projectile.


⚙️ Step 5: Noise Logic (Impact)

In BP_Throwable Event Graph:

  1. Add Event Hit.
  2. Exclude player collisions:
    • Get Player Controller → compare with Other Actor → Branch.
  3. True branch → Add Do Once (prevents spam from bounces).
  4. Add:
    • Play Sound at LocationBallDrop_Cue
    • Report Noise Event:
      • Location = Hit Location
      • Loudness = 1.0
      • Tag = ball
      • Instigator = Player Controller
    • Print String → “We made some noise” (debug).

👉 Each throw now emits sound + noise perception for AI.


⚙️ Step 6: Throwing the Object (Character Blueprint)

In Player Character Blueprint:

  1. Add Arrow Component (spawn point). Position:
    • X = 60, Y = 50, Z = 60
  2. Event Graph: On IA_Throw Pressed:
    • Spawn Actor from ClassBP_Throwable
    • Transform = Arrow World Transform
    • Collision Handling = Always Spawn (ignore collisions)
  3. From return value:
    • Get Projectile Movement → Set Velocity
    • Velocity = Actor Forward Vector × 2000

👉 Ball now spawns & launches in front of player when pressing Q.


⚙️ Step 7: AI Hearing Perception

In BP_EnemyGuard:

  1. Select AI Perception Component.
  2. Add new Sense Config → AI Hearing Config.
    • Hearing Range = adjust to your map (e.g., 1500–2000).
    • Max Age = 5s (memory span for noise).
    • Detection by Affiliation → Check Detect Neutrals & Friendlies.
  3. Optionally → set Dominant Sense = Hearing.

👉 AI now listens for noise events.


⚙️ Step 8: Blueprint – Reacting to Noise

In Event Graph of Enemy:

  1. From On Target Perception Updated → break AI Stimulus.
  2. Check Tag = ball.
  3. If true → Run AI Move To:
    • Pawn = Self
    • Destination = Stimulus Location
  4. If false → keep old sight logic (chasing player).

👉 Enemy now investigates noise sources like thrown balls.


⚙️ Step 9: Fix Forget Logic for Noise

👉 Prevents cast failures when AI forgets non-player stimuli.


⚙️ Step 10: Testing & Refresh

  1. Delete old enemy actors from level.
  2. Drag fresh BP_EnemyGuard into level (ensures no cached logic).
  3. Hit Play:
    • Press Q → ball spawns & lands → noise event triggered.
    • Enemy hears → moves to location.
    • If no player seen → forgets after 5s → resumes patrol.

✅ Final Results

You now have:

This lays the foundation for stealth mechanics and more dynamic AI behaviors.


🔗 Resources

📺 Watch the full tutorial here:
👉 https://www.youtube.com/watch?v=-3o779k_QMo

Code