Destroy all actors inside a sphere collision

Try using this.

238161-function.png

Add any actors that shouldn’t be checked for, including the bomb, to the Actors to ignore list then pass in the position/radius of the bomb.

So I’m making a 2d game that a bombs fall and destroy the floor. I have the explosion but I can’t make it destroy all objects. Overlap events doesn’t work to me becouse it only affects when it is moving like, when an actor enters or exit the collision. I want to destroy all objects inside the collision here is the bomb script and a video of the game.

Bomb script (the floor has a trigger so I’m working on levels bp) :

and a video:

Any ideas??

Two options for you, both explained by Matt Wadstein in his excellent “WTF?” series.

This is the “right” way to do it in UE4. You tap into the damage system and apply radial damage.

[This][2] is more of a direct answer to your question. You call that and you can get overlap info on-demand.

Also keep in mind that with 2D you don’t need a sphere, but I guess you don’t have much of a choice unless you go full 2D instead of 3D side-scroller.

ok now I’ll try ty

okey so I have made this, I have it working properly, when my bomb is destroyed the sphere radius appears. But It doesn’t destroy the actors. I have Them setted as world static actors and I arrayed this to it. Any ideas?

(I have asked the same to the other guy but if u can help to :P) okey so I have made this, I have it working properly, when my bomb is destroyed the sphere radius appears. But It doesn’t destroy the actors. I have Them setted as world static actors and I arrayed this to it. Any ideas?

Did you check if the array coming out of the SphereOverlapActors is empty ?

no how I check it I never use arrays on bps I do basic staff

Right click on DestroyActor and add a breakpoint. Start up the project and trigger a bomb event. If the breakpoint hits then it means the array is being filled out. Hold your mouse over the output array to see what it contains.

If the breakpoint does not get hit then the array is not being populated. Make sure that the actors you’re trying to destroy are WorldStatic actors.

okey this is what I have:

When u say hold your mouse you refer to tht? :

This is my sprite and is the right way?

okey, I have screached more and I made a new question based on that one (I have it working but only with 3d actors). So is this better now?

actually on that way that u say works too but only with 3d models so I think its the good answer for this question if u want to know how help me go on the other and answer me ty :DD

okey if someone is intrested. U have to make the sprite an actor so it will work properly :smiley: