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!!!
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.
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!
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)
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.
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.
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.