I’ve integrated the “Weapon Component” Marketplace asset into my project, and the “projectile” Actor created receives an “Event Hit” with an invalid HitLocation(nan,nan,nan), which causes the code called inside the event handler to produce a native stack-trace.
Output in Log looks like this (first two lines are my own Print String calls):
LogBlueprintUserMessages: [CharacterWeapons] CharacterWeapon.CALLED Weapon.Fire
LogBlueprintUserMessages: [BPA_ParentProjectile_C_0] EventHit: START: HitLocation=X=-nan(ind) Y=-nan(ind) Z=-nan(ind), ActorLocation=X=-520.068 Y=-872.173 Z=245.926
LogOutputDevice: Warning: Script Stack:
BPA_ParentProjectile_C.ExecuteUbergraph_BPA_ParentProjectile
BPA_ParentProjectile_C.ReceiveHit
LogStats: FPlatformStackWalk::StackWalkAndDump - 1.765 s
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: NewTransform.IsValid() [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 611]
LogOutputDevice: Error: Stack:
LogOutputDevice: Error: [Callstack] 0x00007ffdbd2771f6 UE4Editor-Core.dll!UnknownFunction []
...
I could validate the HitLocation, and ignore the hit when the value is invalid, but the HitLocation seems to be always invalid. I would assume that this Event is called by the engine itself, so if the engine give me bad data, I don’t see how am I meant to work around it.
EDIT: That result was with the “shotgun” projectiles. I’ve now tried the “machine-gun”, and the projectiles do get a valid HitLocation. So it seems to be an issue with the “shotgun code” (which I have not written myself), rather than the engine itself. Still, idk what could the “shotgun code” do wrong, to cause the engine to give me an invalid HitLocation.
EDIT#2: I’ve validated that the transform and speed of the projectiles upon spawning is valid, so a bad transform/speed upon creation is not the cause of the invalid hit location.