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):
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.
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.
answered Dec 07 '18 at 12:57 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here