UE5 AI Damage Sense

UE5 AI Damage Sense

Damage reaction is one of those small AI features that makes enemies feel much more believable. If an enemy gets shot and keeps walking around like nothing happened, the AI immediately feels fake. In this Unreal Engine 5 tutorial, you will learn how to use AI Perception Damage Sense so an enemy can react when it gets hit, move toward the reported hit location, and then forget that stimulus after a short time.

This setup uses Blueprints, AI Perception, Report Damage Event, an AI Controller, tag filtering, and a simple forget-to-patrol flow. The goal is not to build a massive Behavior Tree system yet. The goal is to make damage sense work inside the current Blueprint AI setup in a practical and understandable way.

This is especially useful for horror games, stealth games, shooter prototypes, and smaller reactive AI systems where enemies should investigate damage without needing a heavy AI architecture from the start.

Watch the full tutorial on YouTube: Unreal Engine 5 AI Perception Damage Sense Tutorial

Subscribe for more Unreal Engine tutorials: Rambod YouTube Channel

What You Will Build

By the end of this tutorial, your enemy AI will be able to receive a damage perception event, filter it, move toward the stimulus location, and return to patrol when the stimulus expires.

  • An AI Controller with an AI Perception component
  • A Damage Sense configuration with a controlled Max Age
  • A Report Damage Event call after the player damages the enemy
  • A tag such as Shot or Bullet to identify the correct perception event
  • Blueprint logic that receives damage stimuli inside the AI Controller
  • An AI Move To reaction toward the stimulus location
  • A forgotten-event flow that returns the enemy to patrol

This gives you a clean reactive loop: the enemy gets shot, investigates, forgets, and resumes normal behavior.

Why Damage Sense Is Different from Sight and Hearing

If you have already used AI Perception for sight and hearing, damage sense may feel confusing at first. Sight and hearing are usually easy to add directly inside the enemy character Blueprint. You add the sense configuration, receive perception updates, and build your logic from there.

Damage sense is different. It is designed to work more naturally through the AI Controller, which acts as the AI's brain. That means if your older setup keeps most of the AI Perception logic inside the enemy character Blueprint, damage sense may not fit into that structure as cleanly.

In a perfect architecture, you would usually move more AI perception logic into the AI Controller, especially as the system grows. But if your current AI series or project already has patrol, sight, hearing, and chase behavior inside the enemy Blueprint, you may not want to refactor everything immediately.

That is exactly why this tutorial uses a practical workaround. We receive the damage sense inside a new AI Controller, then communicate back to the enemy Blueprint when we need to return to patrol.

Brutally honest: this is not the final architecture you would want for a serious advanced AI system. For Behavior Trees, Blackboard, and larger enemy logic, you should move toward cleaner controller-driven AI. But for this stage, this setup is practical, clear, and good enough to teach how Damage Sense actually works.

How the Damage Sense Flow Works

The full system has two sides:

  • Sending side: the player shoots the enemy and reports a damage event.
  • Receiving side: the AI Controller receives the reported damage stimulus and reacts.

The shooting logic already applies damage through your existing system. In this tutorial, that system is based on a modular health component from the previous AI chapter. But the same idea works if you use Unreal Engine's built-in damage system with Apply Damage.

The important part is this: after damage is applied, you also call Report Damage Event. Health loss and perception reaction are related, but they are not the same thing. Reducing health makes the target weaker. Reporting damage tells the AI Perception system that a damage stimulus happened.

Step 1: Add Report Damage Event After Your Damage Logic

Open your player Character Blueprint where your firing logic already exists. In this project, the shooting flow uses Enhanced Input, plays a fire montage, spawns muzzle effects, performs a line trace, spawns an impact decal, and then calls the custom damage logic from the health component.

Right after your existing damage node, add:

Report Damage Event

This node is the key part of the sending side. It tells Unreal Engine's AI Perception system that damage happened, which actor was damaged, who caused it, where it happened, how much damage was reported, and what tag should identify the event.

Connect it like this:

  • Damaged Actor: use Hit Actor from your Break Hit Result node.
  • Instigator: use Self, because the player character caused the damage.
  • Event Location: use Get Actor Location from Self.
  • Damage Amount: use the same damage value used by your actual damage system.
  • Tag: use a clear value such as Shot or Bullet.

The Damaged Actor is the enemy that was hit by the line trace. The Instigator is the actor that caused the damage. The Event Location gives the perception system a world-space point related to the event. The Damage Amount keeps the report consistent with your real health logic. The Tag lets you filter this damage event later.

Do not skip the tag. Without tags, your AI logic becomes too generic. Later, your game may have bullets, explosions, traps, fire, poison, fall damage, or scripted events. Tags let you decide what kind of damage the enemy should care about.

Why Report Damage Event Is Not the Same as Applying Damage

This is a common beginner mistake. Applying damage and reporting damage are separate actions.

Apply Damage or your custom health component reduces health. Report Damage Event sends a stimulus into AI Perception.

If you only reduce health, the enemy can die or lose health, but the AI Perception system has no damage sense event to react to. If you only report damage but never reduce health, the AI can react, but the gameplay damage itself does not happen.

For a proper system, you usually need both: apply the damage, then report the perception event.

Step 2: Create a New AI Controller Blueprint

The receiving side should live inside an AI Controller. Open the Content Drawer, go to your AI folder, right-click, and create a new Blueprint based on:

AI Controller

Name it:

BP_AIController

This Blueprint will receive the Damage Sense event and decide what the enemy should do with it.

The reason we create a controller is simple. Damage Sense is meant to be handled by the AI brain, not treated like a random character-side event. Even if your current enemy Blueprint still owns older logic, the controller is the correct place to receive this specific perception event.

Step 3: Add AI Perception to the AI Controller

Open BP_AIController. In the Components panel, add:

AI Perception

Select the AI Perception component. In the Details panel, find Senses Config, add a new sense, and choose:

AI Damage Sense Config

Set the Max Age or expiration age to something like:

10 seconds

Also set the Dominant Sense to the damage sense. This gives the controller a dedicated perception setup for damage stimuli.

Max Age is important because it controls how long the stimulus remains valid. If you want the enemy to investigate for a while and then return to patrol, the stimulus needs to expire eventually.

Step 4: Receive the Damage Event with On Target Perception Updated

With the AI Perception component selected, scroll to the Events section in the Details panel. Click the plus button next to:

On Target Perception Updated

Unreal will create the event in the graph.

This event fires when the AI Controller receives a perception update. In this case, we care about the damage stimulus that was reported from the player character Blueprint.

From the Stimulus output, add:

Break AIStimulus

The broken stimulus gives you access to useful values, especially:

  • Tag
  • Stimulus Location
  • Successfully Sensed
  • Age
  • Strength

For this tutorial, the most important values are Tag and Stimulus Location.

Step 5: Filter the Damage Event with a Tag

Drag from the Tag pin and compare it against the tag you used earlier when calling Report Damage Event. For example:

Shot

Then connect the comparison into a Branch.

This makes the reaction specific. The enemy should only run this logic if the incoming damage perception event matches the kind of event you intentionally sent.

This is a cleaner pattern than reacting blindly to every damage stimulus. In a real game, you might later use different tags:

  • Shot
  • Explosion
  • Trap
  • Fire
  • Melee

Each tag can drive a different behavior. For now, we keep it simple and react only to the shot event.

Step 6: Get the Controlled Pawn and Cast to the Enemy

After the tag check passes, add:

Get Controlled Pawn

This returns the pawn controlled by this AI Controller. Since this controller will be assigned to the enemy guard, the controlled pawn should be your enemy character.

Cast the result to:

BP_EnemyGuard

This cast matters because it confirms the pawn is actually your enemy class. After the cast succeeds, you can safely access enemy-specific variables, movement logic, patrol functions, and custom events.

Step 7: Move the Enemy to the Stimulus Location

After the cast succeeds, add:

AI Move To

Configure it like this:

  • Pawn: use the casted BP_EnemyGuard reference.
  • Destination: use Stimulus Location from Break AIStimulus.

Now, when the AI receives a valid damage event with the right tag, it moves toward the location associated with that damage stimulus.

This behavior works well for lightweight reactive AI. The enemy does not magically know everything. It simply reacts to the reported location and investigates.

You can also increase the enemy movement speed before calling AI Move To if you want a more aggressive reaction. For example, you could make the AI run toward the shot location. In this tutorial, the speed is kept normal so the forget behavior is easier to observe and debug.

Step 8: Assign the AI Controller to the Enemy Guard

Creating BP_AIController is not enough. You must assign it to the enemy.

Open:

BP_EnemyGuard

Select the root of the Blueprint. In the Details panel, search for:

AI Controller Class

Set it to:

BP_AIController

This step is not optional. If you forget it, your controller Blueprint can be perfect and nothing will happen, because the enemy is not actually using it.

If your AI does not react after setup, this is one of the first things to check.

Step 9: Prepare the Enemy to Return to Patrol

The enemy can now react to damage, but it still needs a way to return to normal behavior after the stimulus expires.

In BP_EnemyGuard, find your existing patrol logic. In this AI series, the patrol setup already uses logic near Begin Play that searches for tagged patrol points, chooses one randomly, and moves the enemy toward it.

If you already have a clean patrol event or custom function, reuse it. Do not duplicate the same patrol logic again in another part of the Blueprint. Duplicated logic becomes a maintenance problem fast.

Also, this is a good place to reset the movement speed back to the patrol walking speed. Even if you do not increase speed during damage reaction yet, restoring speed during the forget flow keeps your enemy state predictable.

The return flow should do two things:

  • Reset movement state, such as Max Walk Speed
  • Restart the normal patrol behavior

Step 10: Add On Target Perception Forgotten in the AI Controller

Go back to BP_AIController. Select the AI Perception component and scroll to the Events section. Add:

On Target Perception Forgotten

This event fires when a stimulus expires and is forgotten by the perception system. For this to behave correctly, make sure your project has stale actor forgetting enabled in AI settings if your existing AI system depends on that behavior.

Inside this event:

  1. Call Get Controlled Pawn
  2. Cast it to BP_EnemyGuard
  3. Call your enemy's forgotten or return-to-patrol event
  4. Pass through the forgotten Actor if your event expects it

This creates the bridge between the AI Controller and the existing enemy Blueprint patrol system.

The controller owns the damage perception event. The enemy Blueprint owns the patrol behavior. The forgotten event connects them.

Why the Forget System Matters

Without a forget system, the enemy may stay in an alerted or interrupted behavior forever. That is bad AI design, even in simple projects.

A believable enemy should react to damage, investigate, and then stop caring if nothing else happens. This is especially important in stealth and horror games, where tension depends on temporary suspicion and recovery.

The basic flow should be:

  1. Enemy receives a shot stimulus
  2. Enemy moves toward the stimulus location
  3. Stimulus expires after Max Age
  4. Enemy forgets the event
  5. Enemy returns to patrol

That loop is simple, but it already feels much better than an enemy that either ignores damage or stays permanently broken.

Testing the Damage Sense Behavior

After everything is connected, press Play and test the system.

  1. Pick up the weapon.
  2. Stand somewhere safe.
  3. Shoot the enemy guard.
  4. Move away so the enemy does not immediately catch you.
  5. Watch the enemy move toward the reported damage location.
  6. Wait for the stimulus to expire.
  7. Confirm that the enemy returns to patrol.

In the tutorial setup, the Damage Sense Max Age is set to about ten seconds, so the enemy should forget the damage stimulus after that delay and return to normal patrol behavior.

If the enemy reacts but never returns to patrol, your forgotten event is probably not firing or not connected back to the enemy correctly. If the enemy never reacts at all, check the AI Controller assignment, tag comparison, and Report Damage Event wiring.

Common Mistakes to Avoid

  • Calling health damage but forgetting to call Report Damage Event
  • Using the wrong actor for the Damaged Actor pin
  • Leaving the damage event tag empty or inconsistent
  • Comparing against Shot in the AI Controller while reporting Bullet in the player Blueprint
  • Creating an AI Controller but not assigning it to BP_EnemyGuard
  • Adding AI Perception to the wrong Blueprint and expecting Damage Sense to work like sight
  • Forgetting to configure Max Age for the damage stimulus
  • Not wiring the forgotten event back into patrol logic
  • Duplicating patrol logic instead of reusing the existing patrol event or function

Troubleshooting Checklist

The Enemy Does Not React When Shot

Check whether Report Damage Event is actually being called after your damage logic. Also confirm that the Damaged Actor pin receives the hit enemy actor, not the player or some unrelated object.

The AI Controller Logic Never Runs

Make sure BP_AIController is assigned as the enemy's AI Controller Class. If the enemy is still using the default controller, your damage perception logic will never execute.

The Tag Check Fails

Make sure the tag in Report Damage Event exactly matches the tag comparison inside BP_AIController. If you report Bullet but compare with Shot, the Branch will fail.

The Enemy Moves to the Wrong Location

Check what you are using for the event location and stimulus location. For this setup, the AI moves to the reported stimulus location. If you want the enemy to investigate the impact point instead of the player's location, adjust the Report Damage Event location accordingly.

The Enemy Never Returns to Patrol

Check the Max Age value, stale actor forgetting behavior, the On Target Perception Forgotten event, and the call back into the enemy patrol logic.

The Enemy Reacts Too Slowly

You can increase the enemy movement speed when damage is received, then reset it when the stimulus is forgotten. Just do not forget to restore the patrol speed afterward.

How This Fits Into a Larger AI System

This setup is a practical bridge between beginner Blueprint AI and more advanced AI systems. It lets your current enemy react to being damaged without forcing a full refactor immediately.

However, as your AI grows, you should start moving toward:

  • AI Controller based perception handling
  • Behavior Trees for decision flow
  • Blackboard variables for memory and state
  • Dedicated AI states such as patrol, investigate, chase, attack, and search
  • Cleaner separation between perception, decision making, and movement

This tutorial keeps the system simple because the goal is to understand damage reporting and perception first. Later, the same concept can be upgraded into a stronger Behavior Tree and Blackboard workflow.

When to Use Damage Sense

Damage Sense is useful when the AI should react to being harmed or attacked, even if it did not see or hear the player directly.

Good use cases include:

  • Enemies investigating where a shot came from
  • Guards reacting after taking damage in stealth games
  • Horror enemies moving toward a hit location
  • Simple shooter AI reacting without complex Behavior Trees
  • Enemies entering an alerted state after being attacked
  • Reactive AI that should not rely only on sight and hearing

It is not a replacement for a full combat AI brain, but it is a useful stimulus type when you want damage to affect behavior.

How to Improve This System Later

The basic version moves the enemy to the stimulus location and then returns to patrol after forgetting. That works, but you can improve it a lot.

  • Increase movement speed while investigating damage
  • Add a search animation or alert pose
  • Play a sound or voice line when damage is detected
  • Store the last damage location as a Blackboard value
  • Use Behavior Tree states for investigate and return-to-patrol behavior
  • Make different tags trigger different reactions
  • Use damage amount to control aggression level
  • Combine damage sense with sight and hearing for smarter AI

The tag system is especially important for expansion. A small tag like Shot today can become the foundation for multiple reaction types later.

Quick Blueprint Logic Summary

The player shooting Blueprint sends the damage perception event:

Line Trace Hit
Apply Damage or Custom Receive Damage
Report Damage Event
Damaged Actor = Hit Actor
Instigator = Self
Event Location = Self Location or chosen damage location
Damage Amount = damage value
Tag = Shot

The AI Controller receives and reacts to the stimulus:

AI Perception Component
Damage Sense Config
On Target Perception Updated
Break AIStimulus
Check Tag == Shot
Get Controlled Pawn
Cast to BP_EnemyGuard
AI Move To
Destination = Stimulus Location

The forgotten event returns the enemy to patrol:

On Target Perception Forgotten
Get Controlled Pawn
Cast to BP_EnemyGuard
Call enemy forget or patrol reset event
Reset movement speed
Start patrol logic again

Conclusion

In this Unreal Engine 5 AI tutorial, you built a Damage Sense reaction system using AI Perception, Report Damage Event, tags, an AI Controller, AI Move To, and a forget behavior that returns the enemy to patrol. The enemy can now react when it gets shot, investigate the reported location, and stop reacting after the stimulus expires.

This is not the most advanced AI architecture, and it is not pretending to be. It is a practical Blueprint setup that teaches the important concept clearly: damage can be reported as an AI perception stimulus, received by the AI Controller, filtered by tag, and used to drive enemy behavior.

Once you understand this, you can move the same idea into Behavior Trees, Blackboard variables, stronger investigation states, and more believable enemy reactions.

Watch the full tutorial on YouTube: Unreal Engine 5 AI Perception Damage Sense Tutorial

Subscribe for more Unreal Engine tutorials: Subscribe to Rambod on YouTube

Frequently Asked Questions

What is AI Perception Damage Sense in Unreal Engine 5?

Damage Sense is an AI Perception sense that lets AI receive damage-related stimuli. When damage is reported with Report Damage Event, an AI with Damage Sense can detect that event and react to it.

Do I need an AI Controller for Damage Sense?

Damage Sense is best handled inside an AI Controller because the controller acts as the AI brain. You can keep some existing logic in the enemy Blueprint, but receiving the damage stimulus through the controller is the cleaner approach.

Is Report Damage Event the same as Apply Damage?

No. Apply Damage or a custom damage function changes health. Report Damage Event sends a perception stimulus so the AI can react behaviorally.

Why should I use a tag like Shot or Bullet?

Tags help identify what kind of damage event was reported. This lets you filter the stimulus and make the AI react only to the damage types you care about.

Why does my enemy not react after I shoot it?

Common causes include not calling Report Damage Event, using the wrong damaged actor, mismatching the tag, or forgetting to assign your custom AI Controller to the enemy Blueprint.

How do I make the enemy return to patrol after reacting to damage?

Configure a Max Age for the Damage Sense stimulus, use On Target Perception Forgotten in the AI Controller, then call back into your enemy Blueprint to reset movement and restart patrol logic.

Can I use this with a custom health component?

Yes. The perception report does not require Unreal's built-in damage system. You can call Report Damage Event after your own custom health or damage function.

Can this system work for horror or stealth games?

Yes. It works well for enemies that should investigate being damaged, become suspicious temporarily, or return to patrol if they cannot find the player.

Should I later move this into Behavior Trees and Blackboard?

Yes, for more advanced AI. This Blueprint setup is a good learning step, but larger systems should use cleaner AI Controller, Behavior Tree, and Blackboard architecture.

Rambod Ghashghai

Rambod Ghashghai

Technical Director & Unreal Engine Educator

Senior systems architect and Unreal Engine technical educator with 11+ years of enterprise infrastructure experience. Director of IT at Tehran Raymand Consulting Engineers and creator of Rambod Dev.

Full profile

Continue Unreal Engine 5 Enemy AI Series – Beginner Blueprint Tutorials

Back to Unreal Engine 5 Enemy AI Series – Beginner Blueprint Tutorials playlist • Lesson 15 of 15

What To Do Next

Keep exploring practical Unreal Engine and systems programming work.

Share this page

Send it to your network in one tap.

Instagram doesn’t provide direct web share links. We copy your URL and open Instagram.