Obvious hits dont get registred (projectile)

Grannyboy

Active member
I have this new issue of projectiles not regestering hits on to my targets, please see this video:

For some reason the targets wont die even tho clearly its a bulls eye. What could cause this to happen?

Target setup:
1683741656560.png
 
What does the arrow hit? Did you try the arrow from the demo scene? Maybe your arrow has some gravity to it.
 
I made the arrows stick for better view. Ill try to see if i can debug and log what the arrows hit. Ill get back on that. It seems for now that the error simply goes trough the target and stop in the wall behind:

Also i copied most of the demo scene arrow projectile settings with the exceptions of some layers.
 
Hmm. How can a layer issue cause the projectile to hit sometimes from one angle and sometimes not? I can still hit the object, the issue is that its completly random if it registers or not.
The projectile is still set to hit the layer of the target.
 
If the projectile goes through the object then that's just what it sounds like it's related to. The best way to debug this is to place a breakpoint within the TrajectoryObject and when the arrow gets close see why the cast is not returning the object. Unfortunately I think there is a better way to debug this other than to dig into the code.
 
That is because all Physics.*Cast were changed to Physics.*CastNonAlloc in TrajectoryObject.
Physics.*CastNonAlloc returns all hits not sorted by distance.
I can second this, a distance check is required for the returned objects when using NonAllocated casts. Not that I have tested in this exact scenario or checked the code yet, but if NonAllocated then I have certainly come across the same issue in the past in code of my own.
 
Top