Download

URGENT - Player health and collision

I’m trying to make it so that when an enemy collides with the player character they lose health, as shown via UMG. Also how can I restrain the damage to stop the players health from dropping too fast?

I’m having trouble getting this to work and the deadline for this is Thursday night. Can anyone please help?

This shows how to setup umg with health, energy and mood but can easily be translated to whatever value you want (I suggest you watch the full series but here is where the umg part start: https://www.youtube.com/watch?v=VjKY6z6uP0M#t=52)
For losing health either make use of some overlap events or the Event Hit node and when that fires remove some of the health value.
To stop the events from executing to fast between each other I would suggest looking into and using a Gate node, though I’m not sure that is the best way.

I was able to get the UMG working and the health is removed when colliding with the enemies. However when colliding with the enemies all of the health is depleted at once. I think this is due to the game detecting numerous collisions one after the other, which is why I’m trying to find a way to stop it from executing to fast.

Hello,
At least with a bool and a delay you can reduce damage done. On hit check bool with a branch. On false, event is done, not on true. Then set it true and do the event. At the end of the event, add a 1s delay and then set back to false.

Same thing can be done with a doonce. At the end of the hit, delay and you reset your doonce.

In both case, you can adapt delay time to fit with enemy speed attack.

This is probably due to the way that UMG utilizes the progress bar, I suggest you do something like this in the “get health bar precent”-function:
e43a5c87a84d59066bcdc7d0da1d1eea2dcf05c3.png
And then in your character BP do something like this:
Event_take_damage.PNG
And if you are sure that damage is executing to fast between each damage event you could utilize a gate like this:
a5d76493d5138b4f33427ff79519dc026f4b7cd6.png