Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: Not Selected
more ▼

asked May 04 '14 at 09:02 PM in C++ Programming

avatar image

111 7 9 15

avatar image burak.io Nov 16 '14 at 06:22 PM

I have the same problem. Please help.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Aug 29 '16 at 05:06 AM

avatar image

6 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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?

more ▼

answered May 04 '16 at 10:18 PM

avatar image

29 4 4 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question