How can I find out which actor was just destroyed using FActorDestroyedSignature?

Hello, is there a way to get a reference to the Actor that was just destroyed when using the FActorDestroyedSignature delegate? What I’m doing is maintaining a list of unit actors in my game (adding them in the FOnActorSpawned delegate in the UWorld object. And when I add them to my list, I then bind a method to that actors OnDestroyed delegate. The problem is, that method doesn’t notify me as to which Actor was destroyed. I also can’t just pass that in as the payload because the FOnActorSpawned delegate is dynamic. Is there a way to get a delegate notification when an actor is destroyed, while still being able to determine which actor it was that got destroyed?

I have the same problem. Please help.

Ran into this issue today myself. There is no way currently. Seems like it should pass the AActor* being destroyed to the event handlers. Very trivial to fix if you have engine source by altering the signature, and updating the 1 place in code it’s being broadcast (as of 4.10 anyway). Problem though is that changing the signature will break any blueprints that bind to it. So maybe we can convince Epic to make the change for future versions of the engine. Perhaps they could add a new delegate in the meantime while deprecating the old version?

The simple solution that I found to this is to create your own EventDispatcher/Delegate which takes an Actor reference as a parameter. Then in the actors OnDestroyed event you can call the delegate, (passing in a reference to self) then bind to this new delegate instead.