"Is pending kill" error?!

I’ve got a static mesh in my map that I want to move, then disappear never to be called again.

Now when I try to remove it after it’s done any movement needed and is itself no longer needed the editor throws up an error after each time the maps played.

I’m using function destroy actor to remove it from the game, this function is triggered after all the movement needed has been completed for the mesh in question, there are no other references to it in the map that I can see, but I still get an error stating object is pending kill??!

Any ideas on how to remedy this?

remedied by using set visibility instead of destroy actor

You can also use the IsValid? node to check if the actor is still valid(not yet destroyed).

Thanks for that

Are there casts to your static mesh? you should also run destroy actor in the static mesh blueprint itself not from the level blueprint unless you have a do once, i mean if you’re running it through a tick in the level bp it’ll keep trying to destroy the actor all the time but it’s already destroyed and cannot communicate with it, that’s what makes that error, also if you’re looking at easing load it’s best if you get it sorted out and properly destroyed

No casts, not done on tick (I saw that answerhub post too)!

So no idea why that error is happening!

post some screen shots of your blueprints

Thanks for trying to help but I got it sorted without using a destroy actor function

I really appreciate the help anyhow

I was still getting this error even when I checked IsValid? and cleared associated timers - I used SetLifeSpan with a small value and it solved the problem.

1 Like