Callback / event when actor is deleted

Hi,

I’m trying to detect when one of my blueprint actors is deleted in the editor, is there any way to do that?

I’ve been using BeginDestroy when writing C++ actors, but I can’t seem to find an equivalent in blueprints.

Any help or points in the right direction is appreciated.

Thanks,
Dave

your question is a bit confusing but are you looking for [Destroy Actor] node?

I’ve never had any issues using destroy actor but I guess you could use an [Is Valid] node to check if it still exists after it’s destruction.

hope that helps.

Apologies if it’s confusing.

I’ve no problem deleting an actor.
I want to find out when one of my actors is being deleted by the user. So in C++ the BeginDestroy function is called when an actor is being deleted. But there doesn’t appear to be a function or callback in blueprints that lets you know when an actor is being deleted.

You have two Events for (about being) destroyed Actors:
y2EdgMG.png

2 Likes

Thanks Raildex_ appreciate the post. Event end play is the best so far, but it never gets fired when an actor is deleted in the editor, know of any others?

For anyone in future; from looking at the C++ code, there’s no call out to blueprints to let it know that it’s being deleted.

Nope, I faced the same thing while developing my C++ plugin. I only found a way to bind a custom function to an event called “OnLevelActorDeleted”.

That event is not available in BPs and needs C++. No idea if it’s a good idea to bind that in the Actor that is actually getting destroyed.
Haven’t reworked it yet, so I can’t tell you a better way.

Thanks a lot. Exactly what i was looking for.

My player Hud reference in the player character was not destroyed by my gamemode (which destroyed my player character).

Now it is, and i can respawn another character without having a huge fps loss everytime.

Much love.