AI and Streaming levels

UE crashes when I copy an AI Actor on my Streaming levels.
It might come from binding delegates to the Patroller.
The error says :

MachineId:C1E158554EB834F85F766D93714B7BC2
EpicAccountId:54d3316924f2453b8a9f4c319286140f

Access violation - code c0000005
(first/second chance not available)

UE4Editor_Noraneko_9624!APatrollerController::Possess()

  • 719 bytes [e:\projets\straycatblues\git2\noraneko\source\noraneko\private\patrollercontroller.cpp:53]
    UE4Editor_Engine + 6512254 bytes
    UE4Editor_Engine + 6464908 bytes
    UE4Editor_Engine + 2162622 bytes
    UE4Editor_Noraneko_9624!APatroller::PostInitializeComponents()
  • 47 bytes [e:\projets\straycatblues\git2\noraneko\source\noraneko\private\patroller.cpp:48]
    UE4Editor_Engine + 5046642 bytes
    UE4Editor_Engine + 9906019 bytes
    UE4Editor_Engine + 3804899 bytes
    UE4Editor_UnrealEd + 4271756 bytes
    UE4Editor_UnrealEd + 4561611 bytes
    UE4Editor_UnrealEd + 4660963 bytes
    UE4Editor_UnrealEd + 1801811 bytes
    UE4Editor_UnrealEd + 6686342 bytes
    UE4Editor!FEngineLoop::Tick() + 3876
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launchengineloop.cpp:2214]
    UE4Editor!GuardedMain() + 479 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launch.cpp:131]
    UE4Editor!GuardedMainWrapper() + 26
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
    UE4Editor!WinMain() + 249 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
    UE4Editor!__tmainCRTStartup() + 329
    bytes
    [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

The code :

void APatroller::PostInitializeComponents()
{
	Super::PostInitializeComponents();
	PatrollerSensor->OnSeePawn.AddDynamic(this, &APatroller::OnSeePawn);
	PatrollerSensor->OnHearNoise.AddDynamic(this, &APatroller::OnHearNoise);
}

Have you tried debugging it? The callstack clearly indicates a crash in your code. My guess would be that PatrollerSensor (whatever that is) is null.

Cheers,

–mieszko