Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

ReceiveHit/Event-Hit returns invalid HitLocation(nan/nan/nan)

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:
 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.

Product Version: UE 4.20
more ▼

asked Dec 05 '18 at 12:10 PM in Blueprint Scripting

avatar image

1 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Well, if anyone gets that too, the problem was that the weapon was firing multiple projectiles at the same time, and they were colliding with each other right on spawn, so I had to create a new collision object channel and presets, so that projectiles don't collide with each other.

more ▼

answered Dec 07 '18 at 12:57 PM

avatar image

1 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question