# After Taking ANY DAMAGE become INVINCIBLE for 3 Sec

**URL:** <https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [December 2, 2014, 10:15pm UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405 "2014-12-02T22:15:05Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 2, 2014, 10:15pm UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/1 "2014-12-02T22:15:05Z")

</div>

I need help here: I need MyCharacter to become INVINCIBLE for 3 Seconds after taking Damage.

The issue is that when the EnemyPlayer Overlaps MyCharacter, the Damage is applied. BUT it hit’s MyCharacter 2 - 4 times instantly. (25 damage per hit x4 = 100 Damage Instantly)

So I added an IMPULSE to create a Knockback effect after Damage is received. But I was still taking up to 4 hits Instantly.

I added a Delay AFTER the Impulse, but BEFORE the Health subtraction.

Technically this “Kinda works” but it’s only a Duct Tape answer.

I feel like this is a very Simple fix, but I know next to nothing about programming.  
ANY Help is Appreciated!!!

 ![22809-mycharacterinvincibilityissues.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/2/3920774a6ff2c8f4f2de6c498d7cb69d39510827.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_642ca581](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_642ca581](https://forums.unrealengine.com/u/anonymous_user_642ca581)\
**Post date:** [December 3, 2014, 9:30am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/2 "2014-12-03T09:30:42Z")

</div>

i would put the delay into the character dealing the damage once every few seconds then in you’re character EVENT ANY DAMAGE can only trigger as it is being dealt not on overlap.

---

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 3, 2014, 10:16am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/3 "2014-12-03T10:16:59Z")

</div>

Thanks for the idea , but I tried that about a week ago. The NEW problem that creates… if there is more than 1 enemy attacking MyCharacter at once, the player takes Damage from every source and hitting MyCharacter multiple times and killing MyCharacter in a blink of an eye.

This is what I’m looking for:

After MyCharacter receives any Damage = MyCharacter Can NOT receive ANY Damage for 3 Seconds

This has been PLAGUING ME for almost 2 Weeks & I Seriously need Help!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_642ca581](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_642ca581](https://forums.unrealengine.com/u/anonymous_user_642ca581)\
**Post date:** [December 3, 2014, 10:55am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/4 "2014-12-03T10:55:11Z")

</div>

Ok,  
1 after EVENT ANY DAMAGE use a BRANCH connect false to ADD IMPULSE.  
2 Create a variable (bool) name it Invincible (default unchecked) Use it to switch the branch.  
3 after SET HEALTH, SET INVINCIBLE to true (checked)  
4 after you’re health =0 BRANCH (FALSE) use a DELAY set it to 3 sec  
5 after DELAY, SET INVINCIBLE to false (unchecked)

---

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 3, 2014, 9:32pm UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/5 "2014-12-03T21:32:06Z")

</div>

I’m having a little trouble following your steps , is there any way that you could mock up a picture of a working Blueprint for me to see?

Thanks again for your help by the way.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_642ca581](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_642ca581](https://forums.unrealengine.com/u/anonymous_user_642ca581)\
**Post date:** [December 3, 2014, 11:25pm UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/6 "2014-12-03T23:25:32Z")

</div>

![22896-invincable.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/e/a0e991ab5d916da6e460c41e89a4c4720e8ceb1d.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_642ca581](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_642ca581](https://forums.unrealengine.com/u/anonymous_user_642ca581)\
**Post date:** [December 3, 2014, 11:28pm UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/7 "2014-12-03T23:28:00Z")

</div>

hope this works for you pal, make sure the default value is unchecked or it will never receive damage

---

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 4, 2014, 12:49am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/8 "2014-12-04T00:49:16Z")

</div>

I SALUTE YOU!

(っ⌒‿⌒)っ Virtual HUG!

Thank you SO MUCH

---

<div class="post-metadata">

**Author:** ![Justin.Dooley](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/justin.dooley/32/1194553_2.png) [@Justin.Dooley](https://forums.unrealengine.com/u/Justin.Dooley)\
**Post date:** [December 4, 2014, 1:08am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/9 "2014-12-04T01:08:31Z")

</div>

You can also use a gate / sequence to do the same thing without the variable at all. I just grouped all the Knockback code into a function to clean it up.

 ![22899-invincible3sec.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/e/a0e3c81acd1884cef1524471e6f2aca05287495f.png)

---

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 4, 2014, 1:15am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/10 "2014-12-04T01:15:03Z")

</div>

Thanks Justin!

I’ll try this way too & see which one flows best with everything.  
You guys are great in here!  
LOVE UE4 ANSWERHUB!

---

<div class="post-metadata">

**Author:** ![Glotty\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Glotty\_1](https://forums.unrealengine.com/u/Glotty_1)\
**Post date:** [December 4, 2014, 1:55am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/11 "2014-12-04T01:55:10Z")

</div>

![22906-thiscouldwork.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/c/42c26b45d1cea94196aa7540a317e9caefb241a7.png)

This might work, can’t comment if its the best way, i’ve seen mention of timers but i’ve not used them yet.

place that after applying damage.  
that will set “candamage?” to false for 3 seconds (timeline float track with two points, point 1: time=0, value=0 point 2: time=3, value=1) then just put a check before applying damage to see if candamage is set to true.

---

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 4, 2014, 2:07am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/12 "2014-12-04T02:07:47Z")

</div>

Thanks Glotty!  
You guys are all great.

I’ll try this one as well.

---

<div class="post-metadata">

**Author:** ![Glotty\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Glotty\_1](https://forums.unrealengine.com/u/Glotty_1)\
**Post date:** [December 4, 2014, 2:10am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/13 "2014-12-04T02:10:49Z")

</div>

No problem, I had not noticed the other reply (which is actually a much better way, I had no idea there was a delay node).

---

<div class="post-metadata">

**Author:** ![oDESPERADOo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oDESPERADOo\_1](https://forums.unrealengine.com/u/oDESPERADOo_1)\
**Post date:** [December 4, 2014, 2:24am UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/14 "2014-12-04T02:24:45Z")

</div>

Delay nodes are Fantastic

---

<div class="post-metadata">

**Author:** ![FoundThePin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FoundThePin](https://forums.unrealengine.com/u/FoundThePin)\
**Post date:** [November 17, 2017, 3:46pm UTC](https://forums.unrealengine.com/t/after-taking-any-damage-become-invincible-for-3-sec/300405/15 "2017-11-17T15:46:44Z")

</div>

I would imagine the issue with being hit multiple times instantly may be down to multiple components, within the actor applying the damage, generating overlaps with your characters collision. Therefor the Event is called for each component that overlapped.
