Idk how to fix this unreal crash error

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x0000000000000000

UnrealEditor_SimpleShooter_3980!AShooterPlayerController::GameHasEnded() [C:\Users\jeetesh\OneDrive\Desktop\SimpleShooter\Source\SimpleShooter\ShooterPlayerController.cpp:25]
UnrealEditor_SimpleShooter_3980!AKillEmAllGameMode::EndGame() [C:\Users\jeetesh\OneDrive\Desktop\SimpleShooter\Source\SimpleShooter\KillEmAllGameMode.cpp:33]
UnrealEditor_SimpleShooter_3980!AKillEmAllGameMode::PawnKilled() [C:\Users\jeetesh\OneDrive\Desktop\SimpleShooter\Source\SimpleShooter\KillEmAllGameMode.cpp:20]
UnrealEditor_SimpleShooter_3980!AShooterCharacter::TakeDamage() [C:\Users\jeetesh\OneDrive\Desktop\SimpleShooter\Source\SimpleShooter\ShooterCharacter.cpp:117]
UnrealEditor_SimpleShooter_3980!AGun::PullTrigger() [C:\Users\jeetesh\OneDrive\Desktop\SimpleShooter\Source\SimpleShooter\Gun.cpp:40]
UnrealEditor_SimpleShooter_3980!AShooterCharacter::Shoot() [C:\Users\jeetesh\OneDrive\Desktop\SimpleShooter\Source\SimpleShooter\ShooterCharacter.cpp:161]
UnrealEditor_SimpleShooter_3980!TBaseUObjectMethodDelegateInstance<0,AShooterCharacter,void __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [D:\Unreal Engine\UE_5.0\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:594]
UnrealEditor_Engine!FTimerUnifiedDelegate::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Public\TimerManager.h:51]
UnrealEditor_Engine!FTimerManager::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TimerManager.cpp:925]
UnrealEditor_Engine!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1595]
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



HUD is probably nullptr which you dereference.

i have created these new hud here is the blueprints
image




That doesn’t say anything about HUD, the variable in your code.

Did you check if the issue was with HUD?

if (HUD)
{
    HUD->RemoveFromViewport();
}
else
{
    UE_LOG(LogTemp, Error, TEXT("HUD was nullptr!"))
}

when i stop executing this Event BeginPlay in the ShooterCharacterBP It worked fine
so,maybe the error was causing in this blueprint
![image|690x158]
image

im checking if its not a null ptr
image

That only protects you from dereferencing a null pointer on the next line. If CreateWidget returned nullptr, you don’t dereference a null pointer when you attempt to add it to the viewport. However what’s stopping it in the code I mentioned?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms