Sphere collision not detecting every targets

Hello everyone.

I have some issue with a sphere collision not detecting all the targets it is supposed to collide with.

So in this screenshot you can see a red circle in the middle, which is the explosion radius of my sphere. In the top left corner is the index of every targets that the sphere came across. Those targets were destroyed, but as you can see there are still 2 (almost 3) other targets of the same class in the circle, unharmed…

Here is the code executed at my anti-missile explosion. The sphere radius change from 0 to 300 (to avoid weird spawn problem) and then loop through all overlapping actors of the enemy class to destroy them. I tested with a sphere of a radius of 30 000 and the issue was still there, plus the game is 2D so all the enemy are on the same plan, only the sphere is 3D.

I really have no idea why it’s not working. I have no clue why some enemies don’t die while some do, that doesn’t make any sense to me.

Any idea ? :confused:

Would event dispatchers work better for something like your setup?

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/EventDispatcher/

Try checking the “Multi Body Overlap” in the collision settings and see if that works.

218600-ss.png

Nope, still the same. I’m trying another way, with “Get All Actor From Class”, because there won’t be that many enemies on screen so that will do the trick. I’m then comparing distances and destroy if <= my sphere radius.

I think I will delete the sphere altogether, but that doesn’t explain why it wasn’t working in the first place.

Use GetOverlappedActors in Tick for some short time, and filter it by missile class.

I don’t know what is the speed of your projectiles, but, if you can, slow them down just to make sure.

Using GetOverlappingActors will detect only when the function calls (limited by a tick rate for instance), on the other hand, using the own physics engine to detect overlaps will suits better in that case, since it will detect the collision even if it happens between the tick delta.

They are really slow, nothing like a bullet. They are supposed to be slow enough to be intercepted by the player. The engine sure is capable of detecting that.

Well I just cannot figure out where the issue was, so I swtiched to a getAllActorFromClass and just did some quick maths to compare with the explosion radius. Everything is working now, and I deleted the sphere.