Assertion failed: DelegateOwner->IsValidLowLevelFast(false)

I made the mistake of putting this line into the UHealthComponent constructor, which caused my project to crash:

GetOwner()->OnTakeAnyDamage.AddDynamic(this, &UHealthComponent::TakeDamage);

I’ve since moved it out of the constructor and into BeginPlay(), and then built in VS Code. Unfortunately, my project still crashes on startup with the same error. Line 14 of HealthComponent.cpp was the original line in the constructor, so Unreal isn’t recognizing that I’ve updated the code:

Assertion failed: DelegateOwner->IsValidLowLevelFast(false) [File:C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SparseDelegate.h] [Line: 196]

UE4Editor_Core
UE4Editor_Core
UE4Editor_ToonTanks_1166!UHealthComponent::UHealthComponent() [E:\User\Documents\Projects\Unreal\ToonTanks\Source\ToonTanks\Components\HealthComponent.cpp:14]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Core
UE4Editor_Core
UE4Editor_Projects
UE4Editor_Projects
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

How do I fix the project so that I can open it and continue?

Never mind, I found the solution immediately after posting.

Delete the Binaries, Intermediate, Saved, and (if using VSCode) .vscode folders and the .code-workspace file. Then right-click on the uproject file and choose “Generate Visual Studio project files.” If it asks to rebuild, choose Yes.

After doing this, the project works again. I’ll leave this here in case anyone else has this issue in the future.

1 Like

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

Privacy & Terms