EMP effect which find and destroy electric devices

Hi guys, I am trying to figure out how to make EMP which after trigger use will find all electric devices in certain area and destroy them. Any Ideas?? thanks for any help

Should be pretty easy. When the device explodes, have it broadcast the event (via event dispatchers or delegates) and have any electronic devices listen for it, then execute whatever code you want on the electronic devices’ callback functions, like lights turning off, etc. You could also just use “GetOverlappingActors” when the EMP explodes (gonna need some sort of collision box, most likely a sphere collisiono), check if any of those actors have an Electronic tag (or whatever you decide to tag EMP-able objects), and use a for loop to iterate through the OverlappingActors array while checking for that tag. For each object with the tag, execute the EMP function. Just make sure to put an Actor Tag on each electronic object so the EMP will properly call them.

The 2nd method is far less efficient than an event dispatcher but Event Dispatchers can be confusing if you don’t know how to use them lol


just tried this but it still destroying also electronics which is not in the range of sphere and i dont know why

You’re destroying a different array of actors than the one being produced by “Sphere Overlap Actors”. Try connecting the Out Actors pin on the Sphere Overlap Actors node directly to the Target pin of the Destroy Actor node. Better yet, use a for each loop to ensure you iterate over each result

1 Like

thats doing nothing at all i tried it with for each loop node and also without it, maybe i have a mistake in BPI i made but its just like this