Checking if an actor is destroyed

I’m having an enemy with sword and shield attacking the player armed with a gun. The shield, if intercepting the projectile, mitigates the damage done to the enemy, and if hit enough is destroyed. On death of enemy, his sword and shield is destroyed along with the body of the enemy. But as the shield may have been destroyed before the enemy dies, get the following message in the Message Log-Play in Editor:

Cannot access ‘Test_Shield_BP_C_2’. It is pending kill. Property: ‘ShieldTest’ from node DestroyActor in graph ‘EventGraph’ in blueprint EnemyCharacter

What I’m looking for, and have not yet found, is a way to check if the shield is destroyed before trying to destroy it on enemy death.

1 Like

Assuming your character holds a reference to the shield, you could set this variable to None when the shield is destroyed. You can then simply use an IsValid check to see whether the shield still needs to be destroyed.

Thank you, that solved it