You could do something like this by making an interface with some function X. Then at a later point you can gather all actors using that interface and call the function. Would that get you what you need?
I have a 2 games
first its like a moba. hen a player dies it should launch the event Idie, so every player gets it, the game mode and ui idgets,recentrly spawned minions,etc. Right now im using the player dies calls a function on game mode and it launch the event. I would like not to use intermediates for it.
My other game its a board with blocks. under certain circunstances i the board launch the event ClearAllRedblocks(example). then all blocks gets the event and they check if they are red to destroy them self.
right now im including a reference to the board every time they are created, but in a future there will be other actors spawned by diferent actors, so pass the reference will become more messy.
The getallactorofClass option its a problem because performance and design reasons. Too dirt to my taste and i prefer to leave it as last option.
So you want to launch an event and have a set of unrelated actors be able to respond to that event? That still seems like a good use of interfaces. You don’t necessarily have to use getallactorsofclass to make the call. How you do that is dependent on how you’ve structured your project (btw there’s an interface-specific version of that function).
I must say I don’t really find the concept of a global static delegate in either C# or C++ to be a good design decision so I wouldn’t try it personally however that’s your prerogative, I don’t intend to impose. Did you already try declaring a static delegate member of a UCLASS and it didn’t work? Did you try using a global-scoped delegate? That seems to be the closest pattern to what you are trying to describe.