# How to play Death Animation whenever the enemies Health is 0? (In Blueprints or C++ and spawn again with the AI Controller)

**URL:** <https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910>\
**Category:** Character & Animation\
**Tags:** unreal-engine, Blueprint, UE4-27, question\
**Created:** [December 23, 2021, 5:21am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910 "2021-12-23T05:21:44Z")\
**Posts on this page:** 16\
**Page:** 6

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 12, 2022, 5:09pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/103 "2022-01-12T17:09:31Z")

</div>

It’s showing this, in my Debug for BP\_Spawner.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/7/f7ea187189d04de991bd529361760c6741ef7ab6.png)

Breakpoint:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/c/5cf521eb553bd70966a8588e48f775ad8a67a302.png)

Debug Tab:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/e/3ec721336b13baf18978f2a8b6afc43faef4d287.png)

---

<div class="post-metadata">

**Author:** ![Limanima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/limanima/32/248560_2.png) [@Limanima](https://forums.unrealengine.com/u/Limanima)\
**Post date:** [January 12, 2022, 9:29pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/104 "2022-01-12T21:29:23Z")

</div>

But is it stopping in the breakpoint or not?

---

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 13, 2022, 4:42am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/105 "2022-01-13T04:42:56Z")

</div>

How do you know whether it’s stopping or no?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/3/83400bee64f8c1563d36b4d7fdd0db31b145f3ba.png)

---

<div class="post-metadata">

**Author:** ![Limanima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/limanima/32/248560_2.png) [@Limanima](https://forums.unrealengine.com/u/Limanima)\
**Post date:** [January 13, 2022, 7:42am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/106 "2022-01-13T07:42:22Z")

</div>

The execution will stop and that blueprint will show up. Is the string “spawn activated” being shown?

Show me the full blueprint where you are calling that Spawn event.

---

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 13, 2022, 11:55am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/107 "2022-01-13T11:55:33Z")

</div>

The Spawn Activated Print String is not shown + the Spawning Print String in BP\_Enemy is not shown.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/8/98ba59794da74d76353ac9144e13815c84b02bc9.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f27400311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f27400311](https://forums.unrealengine.com/u/anonymous_user_f27400311)\
**Post date:** [January 13, 2022, 1:31pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/108 "2022-01-13T13:31:26Z")

</div>

Dude… I look at what you’re doing and it makes me think I’ve learned a lot more UE4 than I thought.

I can absolutely help you, but im not. You obviously aren’t actually watching the tutorials and taking in the information. UE4 is not a walk in the park: after 7 months of it, I can do maybe 10% of things in the engine, and all those are relatively basic. (Though I guess I am almost done with my game Two Guns Two Goals) I still follow tutorials, ESPECIALLY for AI, but I always try to understand WHY things work the way they do. If you’re too preoccupied with getting something running (this may be the pot calling the kettle black but) then you will never learn this engine. You have to actually learn it. Just having the code doesn’t teach you what it is. , Matthew Wadstein. Those two people can answer probably every question a beginner and even intermediate would ask. Look them up on YouTube if you DO want to learn the engine. If not, just stop wasting your time with UE4 and go play Valorant or something, low key.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f27400311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f27400311](https://forums.unrealengine.com/u/anonymous_user_f27400311)\
**Post date:** [January 13, 2022, 1:47pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/110 "2022-01-13T13:47:05Z")

</div>

Dude what I’m literally right

---

<div class="post-metadata">

**Author:** ![PresumptivePanda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/presumptivepanda/32/1194593_2.png) [@PresumptivePanda](https://forums.unrealengine.com/u/PresumptivePanda)\
**Post date:** [January 13, 2022, 10:43pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/111 "2022-01-13T22:43:03Z")

</div>

Hey guys!

Make sure we’re being civil in the forums and encouraging other Unreal Engine community members. Our [code of conduct](https://forums.unrealengine.com/t/forum-rules-code-of-conduct/10) is a great place to start to learn whats expected while on the forums.

Thanks!

---

<div class="post-metadata">

**Author:** ![Limanima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/limanima/32/248560_2.png) [@Limanima](https://forums.unrealengine.com/u/Limanima)\
**Post date:** [January 13, 2022, 10:50pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/112 "2022-01-13T22:50:57Z")

</div>

> [@DeadFalconking](#):
>
> The Spawn Activated Print String is not shown + the Spawning Print String in BP\_Enemy is not shown.

So, if the strings are not shown, obviously the enemy will not spawn.  
Place a single enemy on the map, and right at the beginning of the tick event use print string to print the enemy health and confirm that it reaches zero.

---

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 14, 2022, 11:45am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/113 "2022-01-14T11:45:51Z")

</div>

I placed a single enemy on the map and the enemy health is going to 0.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/e/5e6619afa113fc8842d4ba308dcfa802f591d7ce.png)

---

<div class="post-metadata">

**Author:** ![Limanima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/limanima/32/248560_2.png) [@Limanima](https://forums.unrealengine.com/u/Limanima)\
**Post date:** [January 14, 2022, 11:53am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/114 "2022-01-14T11:53:44Z")

</div>

Place a breakpoint there and run the game.  
After the “branch health \<= 0.” or else it will always stop.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/5/b52314a378657d2aeb7b486d9c8fcdda5a5a43f3.png)  
Here, on the first “Delay”.

---

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 14, 2022, 2:20pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/115 "2022-01-14T14:20:40Z")

</div>

Okay so when I was in the PIE session. It just stopped the moment I shot that particular enemy.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/0/906ac06bd1f3d939a32e164577d0cf40c99d2a15.png)

---

<div class="post-metadata">

**Author:** ![Limanima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/limanima/32/248560_2.png) [@Limanima](https://forums.unrealengine.com/u/Limanima)\
**Post date:** [January 14, 2022, 2:59pm UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/116 "2022-01-14T14:59:24Z")

</div>

You should have something like this:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/e/7e0eff5e8ef0334cd78270ea056a6b990498661f.png)

Now, “Step Into” and check where the execution is going.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/e/7eacf905eb764f086c103f4381fc04521d8cef99.png)

Do you reach Spawn?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/3/53fa6206ed5ece07d9fd28010622f03d9b8a93c9.png)

---

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 15, 2022, 4:04am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/117 "2022-01-15T04:04:52Z")

</div>

Didn’t you tell me to add the breakpoint on Delay? Anyways I did it like you asked too but it didn’t reach spawn.

---

<div class="post-metadata">

**Author:** ![Limanima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/limanima/32/248560_2.png) [@Limanima](https://forums.unrealengine.com/u/Limanima)\
**Post date:** [January 15, 2022, 8:31am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/118 "2022-01-15T08:31:42Z")

</div>

Now, check where it reached and try to understand why it didn’t reach spawn. Cmon man, do a little troubleshoot…

---

<div class="post-metadata">

**Author:** ![DeadFalconking](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deadfalconking/32/250507_2.png) [@DeadFalconking](https://forums.unrealengine.com/u/DeadFalconking)\
**Post date:** [January 17, 2022, 6:28am UTC](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910/119 "2022-01-17T06:28:12Z")

</div>

Okay I figured it out, Enemies are now spawning with no issues. Thank you so much for your help!

[Previous page](https://forums.unrealengine.com/t/how-to-play-death-animation-whenever-the-enemies-health-is-0-in-blueprints-or-c-and-spawn-again-with-the-ai-controller/267910.md?page=5)
