# how to destoy the shield after enemy is destroyed

**URL:** <https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246>\
**Category:** World Creation\
**Tags:** Destroy, unreal-engine, enemy, question\
**Created:** [October 2, 2023, 6:43pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246 "2023-10-02T18:43:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 2, 2023, 6:43pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/1 "2023-10-02T18:43:29Z")

</div>

ive tried to store shiled should be destroyed in a varible and set it to true after destroy actor in enemy blueprint and used a branch in the shield blueprint to check it if true that destroy the shiled but it didnt work out the shield stayed there

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [October 2, 2023, 7:44pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/2 "2023-10-02T19:44:31Z")

</div>

Your post doesn’t make much sense. Could you rewrite the text or add some images to showcase what you are trying to do?

You could run a cast to the shield from the enemy and with the reference destroy it before the enemy is destroyed.

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 2, 2023, 8:14pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/3 "2023-10-02T20:14:18Z")

</div>

the proplem is they both not valid as for the screenshots there they are here

 ![shiled](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/a/b7a6f0b4fcd81caa1025e81c2046cc837316c399.png)  
 ![shiled2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/8/ec8f1bcdc901b7e459966e7b5a2bdd8a0e7e9bab.png)

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [October 2, 2023, 9:27pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/4 "2023-10-02T21:27:12Z")

</div>

You have to do it before you run the destroy function. Anything after destroy function will not run as it has been destroyed. Think of it as layers or a hierarchical structure.

If I have some information and you destroy me, I can do anything for you after that.

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 2, 2023, 9:54pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/5 "2023-10-02T21:54:47Z")

</div>

The only way to do it while calling the destroy function is to add another funcion override for the onDestroyed event.  
And that only works when you explicity call the destruction like you are doing.

Ofc you have to make sure the object being destroyed is the correct one.

Order of operations and all of that.  
Cant destroy self and then expect additional code to be run after its destroyed…

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 2, 2023, 10:39pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/6 "2023-10-02T22:39:21Z")

</div>

thank you and what after ondestroyed i tried destroy actor after that and reference to the shield but that didnt work can you show me a blueprint of this plz

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 3, 2023, 2:26am UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/7 "2023-10-03T02:26:54Z")

</div>

Honestly, its probably a c++ only override?  
Not sure, depends on engine version too.

If you are able to find the override and create your own function - what is the problem exactly? Is it able to do a simple task like “print string”?

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 3, 2023, 8:06am UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/8 "2023-10-03T08:06:34Z")

</div>

the proplem is i really dont know how to destroy actor after enemy on destroyed i tried to make it a value and reference to the actor destroy actor didnt work unfortunatly btw its a blueprint on destroyed function this can be done by blueprints but i dont know how to do that exactly

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 3, 2023, 10:24am UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/9 "2023-10-03T10:24:05Z")

</div>

Really, I’d use a bluprint interface call to get the object to destroy along.

Should be clean and efficient, also reusable…

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 3, 2023, 10:53am UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/10 "2023-10-03T10:53:47Z")

</div>

yea how

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 3, 2023, 11:40pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/11 "2023-10-03T23:40:53Z")

</div>

Look up how to use interface calls.

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 3, 2023, 11:42pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/12 "2023-10-03T23:42:30Z")

</div>

i tried ive seen alot of tutorials but not specfically on that

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 3, 2023, 11:43pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/13 "2023-10-03T23:43:47Z")

</div>

You create the interface, implement it on the shield, and call destroy self from it.

The character then sends the interface call, and that’s all there is to it…

You can expand on funcionality of it as you learn more about the engine;  
For instance you can pass the shield object of the character to make sure only the right actor is deleted from the call… if self == actor then destroy self…

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 3, 2023, 11:46pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/14 "2023-10-03T23:46:31Z")

</div>

can you show me a blueprint plz

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 3, 2023, 11:47pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/15 "2023-10-03T23:47:26Z")

</div>

That I cannot do…

---

<div class="post-metadata">

**Author:** ![mhmdamjd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhmdamjd](https://forums.unrealengine.com/u/mhmdamjd)\
**Post date:** [October 3, 2023, 11:47pm UTC](https://forums.unrealengine.com/t/how-to-destoy-the-shield-after-enemy-is-destroyed/1320246/16 "2023-10-03T23:47:48Z")

</div>

ok
