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

Published: August 06, 2025 • Series: Enemy AI Series • Level: beginner

unreal ue5 enemy ai blueprints ai perception hearing noise stealth gamedev

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

  • Part 1 → Enemy Blueprint + AI Sight
  • Part 2 → NavMesh + Patrol Paths
  • Part 3 → Chasing & Forgetting system

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

  • Creating a throwable distraction object with UE5 modeling tools
  • Setting up 3D sound effects (attenuation & spatialization)
  • Adding Blueprint logic to spawn and throw objects
  • Configuring AI Perception Hearing
  • Making enemies investigate noises then return to patrol
  • Organizing project folders for clean workflows
  • Debugging & best practices for AI events

📝 Chapters

  • 00:00 – Intro & What You’ll Learn
  • 00:54 – Creating a Throwable Object
  • 02:54 – Setting Up Input Action to Throw
  • 04:04 – Adding 3D Sound Effect
  • 05:28 – Organizing Blueprints
  • 06:12 – Throwable Blueprint Component Setup
  • 07:57 – Adding Noise Logic on Impact
  • 10:05 – Spawning & Throwing the Object
  • 13:00 – Adding AI Hearing Perception
  • 14:26 – Wiring AI to React to Noise
  • 15:49 – Fixing Forget Logic for Noise
  • 16:12 – Refreshing Enemy in Level
  • 16:38 – Final Test & Outro

⚙️ 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

  • On On Target Perception Forgotten:
    • Remove old Player-only cast.
    • Directly reset speed → Patrol Speed (300).
    • Resume Patrol loop.

👉 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:

  • Throwable distraction objects 🎱
  • Proper 3D sound & AI hearing 👂
  • Enemies that investigate noises 🕵️
  • Forget system returning them to patrol 🌀

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