Mass Casting

Hey All,
Does anybody know a way to have an actor order a bunch of other actors to perform a task? I’ve been trying to cast to all of my enemy units to get them to attack in sync but I can find any way to do it other than to cast to individuals. If any of you out there could please assist me that would be amazing.

Hey there @TruffleExplorer! Welcome to the community! There’s lots of ways you can handle issuing lots of orders at once, however it gets to be dependent on your use case.

Disclaimer: Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.


Event Dispatcher
So one of the more proper ways (and a bit more advanced) would be to use an Event Dispatcher, and have all of the enemies subscribe to the event. Then from the Dispatcher you can call for that event to occur and all actors that are subscribed will run that event.

Documentation here:

Tutorial Here:


However if you wanted a slightly easier and less efficient way, you could create an array of actors that you want to call this from and add the enemies to it, (likely when you spawn them), assuming they are of the same class (same enemy type, or derive from the same parent class) you can do something like this:


Though I’d highly recommend learning about Event Dispatchers as they would be invaluable in the future!

Hope this helps!

Thank you SupportiveEntity! I read through the documentation and it sounds like exactly what I am looking for so I’ll look into it. You saved me three hours of headscratching so again, thanks!

1 Like