# Enemies are still hitting me when playing death animation

**URL:** <https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959>\
**Category:** Character & Animation\
**Tags:** unreal-engine, UE4, Blueprint, question\
**Created:** [September 9, 2016, 7:38pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959 "2016-09-09T19:38:48Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 7:38pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/1 "2016-09-09T19:38:48Z")

</div>

Hey again guys,

I got everything setup for a nice enemy. But when they die they get a animation (Not the problem) But when you stand at their death location they are sort of there so they cabn still hit you. Is there a way to fix it?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![HenningAx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HenningAx](https://forums.unrealengine.com/u/HenningAx)\
**Post date:** [September 9, 2016, 7:45pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/2 "2016-09-09T19:45:44Z")

</div>

Create a bool in your blueprint called IsDying or something like this and set it to true when the enemy dies and plays his death animation.  
Check this variable before your enemy is attacking to make sure he is not in dying state.

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 7:48pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/3 "2016-09-09T19:48:37Z")

</div>

Can you show me with some Bp screens or a Bprenderer how i can do that? Or do you need a screenshot of my enemy Bp first? So oyu know more

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:00pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/4 "2016-09-09T20:00:00Z")

</div>

Maybe use this? [http://blueprintue.com/](http://blueprintue.com/) to show me

---

<div class="post-metadata">

**Author:** ![HenningAx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HenningAx](https://forums.unrealengine.com/u/HenningAx)\
**Post date:** [September 9, 2016, 8:06pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/5 "2016-09-09T20:06:36Z")

</div>

Create a variable on your blueprint:

![106397-variables.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/f/ceffd2bad86987554cd1bedf5fce6f3fe3d8e70f.png)

Set it to true when the enemy starts dying

 ![106398-diefunc.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/b/bdba1088f4ef99a620a90ea3356758a384f1948f.png)

And check it every time your enemy wants to attack

 ![106399-attackfunc.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/7/40787359e0e4f9fe2713fae3ffb125ceaf955957.png)

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:11pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/6 "2016-09-09T20:11:00Z")

</div>

How do i create that variable? Cus i am using a EnemyCharacter BP for his dying or di have to make a new BP?

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:13pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/7 "2016-09-09T20:13:21Z")

</div>

1. [Screenshot - f1c0a4938cb77db74dec1cd46c101ce2 - Gyazo](https://gyazo.com/f1c0a4938cb77db74dec1cd46c101ce2)
2. [Screenshot - f9eebb3b7e649aefe306e9b8ff14d41c - Gyazo](https://gyazo.com/f9eebb3b7e649aefe306e9b8ff14d41c)

---

<div class="post-metadata">

**Author:** ![HenningAx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HenningAx](https://forums.unrealengine.com/u/HenningAx)\
**Post date:** [September 9, 2016, 8:18pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/8 "2016-09-09T20:18:40Z")

</div>

In your EnemyCharacterBP on the left side is the variables section, just click on the plus to add a variable

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:19pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/9 "2016-09-09T20:19:38Z")

</div>

And how di i get it purple like that?

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:20pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/10 "2016-09-09T20:20:42Z")

</div>

Let’s say it like this: How do i get it like all that?

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:21pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/11 "2016-09-09T20:21:28Z")

</div>

Haven’t got that Gameplay section in the variab;les section aswell

---

<div class="post-metadata">

**Author:** ![HenningAx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HenningAx](https://forums.unrealengine.com/u/HenningAx)\
**Post date:** [September 9, 2016, 8:22pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/12 "2016-09-09T20:22:41Z")

</div>

That were just examples, you should have your own functions for attacking and dying.  
In dying you just add the set  
In attacking you just add the check

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:32pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/13 "2016-09-09T20:32:04Z")

</div>

but cant you sort of dupe my BP and add it in the [blueprintue.com](http://blueprintue.com) cus i dont even understand what you are sying now :’)

---

<div class="post-metadata">

**Author:** ![HenningAx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HenningAx](https://forums.unrealengine.com/u/HenningAx)\
**Post date:** [September 9, 2016, 8:41pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/14 "2016-09-09T20:41:21Z")

</div>

Sorry man, this is really basic stuff. You should probably look some more into the documentation your some of the tutorials provided by Epic.

---

<div class="post-metadata">

**Author:** ![FakeStreamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FakeStreamer](https://forums.unrealengine.com/u/FakeStreamer)\
**Post date:** [September 9, 2016, 8:59pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/15 "2016-09-09T20:59:40Z")

</div>

Yea but i am quite new to this so

---

<div class="post-metadata">

**Author:** ![SunChaserStudio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SunChaserStudio](https://forums.unrealengine.com/u/SunChaserStudio)\
**Post date:** [June 11, 2025, 3:45pm UTC](https://forums.unrealengine.com/t/enemies-are-still-hitting-me-when-playing-death-animation/369959/16 "2025-06-11T15:45:22Z")

</div>

Thank You, adding the detach from controller is all that I needed!
