SimpleShooter stuck at end of course. UE crashes after adding BTTask_Shoot

I’m stuck towards the end of the course on the SimpleShooter game. After I’ve followed along with lesson #188, the editor is crashing when I try to test the changes to the “BTTask_Shoot”. Crash logs don’t seem very helpful and there are no compiler errors.

I don’t even know where to start to debug this.

1 Like
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000000000d0

UnrealEditor_AIModule!UBlackboardComponent::GetKeyID() [D:\build\++UE5\Sync\Engine\Source\Runtime\AIModule\Private\BehaviorTree\BlackboardComponent.cpp:287]
UnrealEditor_AIModule!UBlackboardComponent::ClearValue() [D:\build\++UE5\Sync\Engine\Source\Runtime\AIModule\Private\BehaviorTree\BlackboardComponent.cpp:747]
UnrealEditor_SimpleShooter_patch_0!AShooterAIController::Tick() [F:\Unreal Game Projects\SimpleShooter\Source\SimpleShooter\ShooterAIController.cpp:45]
UnrealEditor_Engine!FActorTickFunction::ExecuteTick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:197]
UnrealEditor_Engine!FTickFunctionTask::DoTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:284]
UnrealEditor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:975]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:753]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:642]
UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2169]
UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:565]
UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1592]
UnrealEditor_Engine!UWorld::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:790]
UnrealEditor_Engine!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1531]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1777]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:474]
UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5215]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
UnrealEditor!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll
1 Like

Could you show your AShooterAIController::Tick?

1 Like

Thank you SO much! I’m really stuck here, derailed my progress (and motivation) by months.

void AShooterAIController::Tick(float DeltaSeconds)
{
    Super::Tick(DeltaSeconds);
    
    APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);


    if(LineOfSightTo(PlayerPawn))
    {
        GetBlackboardComponent()->SetValueAsVector(TEXT("PlayerLocation"), PlayerPawn->GetActorLocation());
        GetBlackboardComponent()->SetValueAsVector(TEXT("LastKnownPlayerLocation"), PlayerPawn->GetActorLocation());        // Setting LastKnownLocation
    }
    else
    {
        //ClearFocus(EAIFocusPriority::Gameplay);
        //StopMovement();
        GetBlackboardComponent()->ClearValue(TEXT("PlayerLocation"));
    }
}
    
1 Like

I have a feeling your Blackboard component is nullptr, could you show the full file please?

1 Like

okay, I appreciate your help, but I figured it out (I think). First I reopened the project today and it defaults to UE5.1 so it rebuilt all the project files. I went back several lessons and retraced my steps to see if I was missing something and meticulously checked all the BT_ related lessons and it just works. I’m going to assume you were right and that there was something wrong in one of my BTService related classes and call it fixed.

1 Like

Privacy & Terms