Quick answer: Add a sense config (e.g. UAISenseConfig_Sight) to the AIPerceptionComponent. Enable “Detect Enemies” and “Detect Neutrals” in affiliation flags. Ensure the target actor is registered as a stimuli source for the relevant sense. If no team IDs are set, actors default to Neutral — check Neutrals is enabled.

Here is how to fix Unreal AI Perception not detecting actors. You add an AIPerceptionComponent to your AI controller or pawn. You configure a sight sense. You run the game and the AI stands there, oblivious to the player standing in front of it. The OnPerceptionUpdated delegate never fires. AI Perception has a chain of requirements — sense config, affiliation, stimuli registration, and team setup — and missing any one of them causes silent detection failure.

The Symptom

The AIPerceptionComponent’s OnPerceptionUpdated or OnTargetPerceptionUpdated delegate never fires. GetCurrentlyPerceivedActors() returns an empty array. The AI debug visualization (EnableDebugDraw) shows the perception radius but no detected actors within it.

Variant: sight works but hearing does not. Or detection works for AI-vs-AI but not AI-vs-player. Or detection fires once and then stops updating.

What Causes This

No sense config added. The AIPerceptionComponent needs at least one sense config object (UAISenseConfig_Sight, UAISenseConfig_Hearing, etc.) to know what to detect. An empty component detects nothing.

Affiliation filter excludes target. Each sense config has three affiliation checkboxes: Detect Enemies, Detect Friendlies, Detect Neutrals. If the target’s team relationship does not match a checked box, it is filtered out before detection logic even runs. Actors without a team ID default to Neutral.

Target not registered as stimuli source. For sight, Pawns are auto-registered. For hearing, damage, and custom senses, the target needs an AIPerceptionStimuliSourceComponent with the relevant sense class enabled, or events must be reported manually via UAISense::ReportEvent.

Perception component on wrong actor. AIPerceptionComponent should be on the AIController or the Pawn. If it is on a random actor that is not possessed or has no AI controller, the perception system may not tick it properly.

Dominant sense not set. The AIPerceptionComponent has a Dominant Sense property. If set incorrectly, the system may prioritize a non-functional sense and ignore the one you configured.

The Fix

Step 1: Add and configure sense config in C++.

// MyAIController.cpp
#include "Perception/AIPerceptionComponent.h"
#include "Perception/AISenseConfig_Sight.h"

AMyAIController::AMyAIController()
{
    PerceptionComp = CreateDefaultSubobject<UAIPerceptionComponent>(
        TEXT("PerceptionComp"));

    SightConfig = CreateDefaultSubobject<UAISenseConfig_Sight>(
        TEXT("SightConfig"));

    SightConfig->SightRadius = 1500.0f;
    SightConfig->LoseSightRadius = 2000.0f;
    SightConfig->PeripheralVisionAngleDegrees = 60.0f;
    SightConfig->SetMaxAge(5.0f);

    // Critical: enable affiliation detection
    SightConfig->DetectionByAffiliation.bDetectEnemies = true;
    SightConfig->DetectionByAffiliation.bDetectNeutrals = true;
    SightConfig->DetectionByAffiliation.bDetectFriendlies = false;

    PerceptionComp->ConfigureSense(*SightConfig);
    PerceptionComp->SetDominantSense(SightConfig->GetSenseImplementation());
}

The DetectionByAffiliation flags are the most commonly missed setting. Without Neutrals enabled, unaffiliated players are invisible.

Step 2: Bind the perception delegate.

void AMyAIController::BeginPlay()
{
    Super::BeginPlay();

    PerceptionComp->OnTargetPerceptionUpdated.AddDynamic(
        this, &AMyAIController::OnTargetPerceptionUpdated);
}

void AMyAIController::OnTargetPerceptionUpdated(
    AActor* Actor, FAIStimulus Stimulus)
{
    if (Stimulus.WasSuccessfullySensed())
    {
        UE_LOG(LogTemp, Log, TEXT("Detected: %s"),
            *Actor->GetName());
    }
    else
    {
        UE_LOG(LogTemp, Log, TEXT("Lost: %s"),
            *Actor->GetName());
    }
}

Step 3: Set up team IDs using IGenericTeamAgentInterface. Without team setup, all actors are team 255 (no team) and treated as Neutral to each other:

// MyAIController.h
class AMyAIController : public AAIController
{
    // ...
    virtual ETeamAttitude::Type GetTeamAttitudeTowards(
        const AActor& Other) const override;
};

// MyAIController.cpp
AMyAIController::AMyAIController()
{
    SetGenericTeamId(FGenericTeamId(1)); // AI team
}

ETeamAttitude::Type AMyAIController::GetTeamAttitudeTowards(
    const AActor& Other) const
{
    auto* TeamAgent = Cast<IGenericTeamAgentInterface>(&Other);
    if (TeamAgent && TeamAgent->GetGenericTeamId() == FGenericTeamId(0))
        return ETeamAttitude::Hostile;
    return ETeamAttitude::Neutral;
}

Set the player’s controller to team 0. The AI (team 1) treats team 0 as Hostile, so “Detect Enemies” now catches the player.

Step 4: Register stimuli sources for non-sight senses. For hearing:

// On the player or noise-making actor, add component in Blueprint
// or in C++:
StimuliSource = CreateDefaultSubobject<UAIPerceptionStimuliSourceComponent>(
    TEXT("StimuliSource"));
StimuliSource->RegisterForSense(UAISense_Hearing::StaticClass());
StimuliSource->bAutoRegister = true;

// To emit a noise event:
UAISense_Hearing::ReportNoiseEvent(
    GetWorld(), GetActorLocation(), 1.0f,
    this, 0.0f, FName("Footstep"));

Debugging AI Perception

Use the AI debug tools at runtime:

// Console command
ai.debug.perception 1

// Or in C++ for a specific controller
PerceptionComp->DrawDebugInfo();

The debug visualization shows sight cones, hearing ranges, and detected actors with colored indicators (green = currently sensed, red = lost). If the cone appears but nothing highlights inside it, affiliation or stimuli registration is the problem.

Understanding the issue

AI bugs are emergent. The code is correct in isolation; the behavior emerges from interaction with other systems. Reproducing means controlling the interaction; fixing means deciding which interaction was wrong.

The specific bug described above is the kind that surfaces during integration rather than unit testing. It depends on a combination of factors: the asset configuration, the runtime state, the platform's specific behavior. In isolation, each piece looks correct; in combination, the bug emerges. This is why thorough integration testing - playing the actual game in realistic conditions - catches things that automated tests miss.

Why this happens

The triage path for this kind of bug is long. The symptom appears in gameplay, but the cause is in a different system. The reporter describes the gameplay effect; the engineer has to translate that into a hypothesis about the underlying cause. Misdirection is common.

At the engine level, the behavior comes from a deliberate design decision in Unreal. The engine team chose a particular trade-off - usually performance versus convenience, or generality versus specificity - and that trade-off has consequences when you push against it. Understanding the trade-off is what turns 'this bug is mysterious' into 'this bug is the expected consequence of this design'.

Verifying the fix

Verifying this fix in isolation is straightforward: reproduce the bug, apply the change, confirm the bug no longer reproduces. The harder verification is regression - did this fix introduce a new bug elsewhere? Run your standard regression suite, plus any tests that exercise the same code path with different inputs.

Reproducibility is the prerequisite for verification. If you can't reliably reproduce the bug pre-fix, you can't reliably verify it post-fix. Spend time getting a clean reproduction before you write any fix code. The fix is fast once you understand the reproduction; the reproduction is the slow part.

Variations to watch for

There's almost always a less obvious case where the same problem applies. The reported case is the one a player hit; the related cases hide because they're rarer or affect fewer players. After fixing the reported case, search the codebase for the pattern - one fix often unlocks several.

Adjacent bugs often share a root cause. After fixing the case you've found, spend an hour searching the codebase for similar patterns. What's the same call with different arguments? The same data flow with a different entity type? The same lifecycle issue in a sibling system? Each match is a candidate for the same fix, or a related fix that prevents future bugs of the same class.

In production

In shipping builds, this issue may interact with other production-only behavior. Stripping, encryption, asset bundling, and platform-specific code paths can each modify the symptoms. When players report a related issue, capture build SHA, platform, and any feature flags - those three fields cover most of the production-only variations.

When triaging a similar issue in production, prioritize gathering data over hypothesizing causes. A player report describes a symptom; what you need is a build SHA, a session timestamp, and ideally a screen recording or session replay. With those, the bug becomes tractable. Without them, you're guessing at hypothetical reproductions that may not match what the player actually hit.

Performance considerations

If this issue manifests under high load (many actors, many particles, many network connections), profile the post-fix code path with realistic counts. The original cost was a bug; the new cost is real work, and real work has a budget.

Diagnostic approach

Diagnosing this class of bug benefits from a structured approach: confirm the symptom, isolate the variables, hypothesize the cause, and verify the hypothesis before writing fix code. Skipping the isolation step is the most common mistake; without it, fixes often address symptoms while the underlying cause continues to produce other variations.

For Unreal-specific diagnostics, the editor's profiler is the canonical starting point. Capture a representative frame with the symptom present; compare against a frame without the symptom; the diff often points directly at the cause. If the symptom is non-deterministic, capture multiple frames and look for the pattern - the cause is usually a state transition or a specific input value rather than a continuous effect.

Tooling and ecosystem

The tooling around this bug class matters as much as the fix itself. Good logging, accessible profilers, and clear error messages turn 30-minute investigations into 5-minute ones. If your project doesn't have visibility into this code path, the first fix should add the visibility - the second fix uses it.

Within Unreal, the relevant diagnostic surfaces include the standard frame debugger, memory profiler, and engine-specific debug overlays. Each one shows a different facet of what's happening. The frame debugger reveals draw call ordering and state transitions; the memory profiler shows allocation patterns; the debug overlay reveals per-system state. Bugs that resist one tool usually surrender to another - the trick is knowing which tool to reach for first.

Edge cases and pitfalls

Edge cases for this class of issue often involve specific timing: the first frame after a state change, the last frame before a transition, frames where multiple subsystems update simultaneously. Reproducing these reliably is part of what makes the bug class hard to test.

When writing a regression test for this fix, focus on the boundary conditions that surfaced the original bug. Tests that exercise the happy path catch obvious regressions; tests that exercise the boundary catch the subtler regressions that look like new bugs but are really the original returning. The latter are the tests that earn their keep over the long life of the project.

Team communication

When this bug class affects multiple teams (often the case for cross-system issues), early communication prevents duplicate work. The team that owns the symptom may not own the cause. A 15-minute conversation at the start of triage often saves hours of independent investigation.

If this fix touches a system several engineers work in, a short writeup in the team's engineering channel helps. Not a full design doc - a paragraph explaining what was wrong, what's fixed, and what to watch for. Future engineers encountering similar symptoms will search for the fix; making it findable is a small investment that pays back later.

“Sense config, affiliation flags, stimuli source. Three links in the perception chain. Break any one and the AI is blind.”

Related Issues

For actor replication in multiplayer AI, see Actor Replication Not Working. For behavior tree integration with perception, GameplayAbility Not Activating covers related AI activation patterns.

ConfigureSense, enable Neutrals in affiliation, register stimuli. Then the AI can finally see.