Create Trap:

R click in Content Broswer → BP class → Actor (name as Spikes)
open the BP → Add cones, scale it down to 0.3
Place the BP in scene, duplicate them

Create PlayerUI:

R click, user interface → Create Widget, open it
Type Canvas Panel, drag it then place progress bar, and Text in (text name as Health)
Progress bar Progress percent set as 0.5
image.png

Open 3rd person BP, create nodes as bellow:
image.png

Create Damage system:

In 3rd person BP, add 2 variables, name as CurrentHealth, and MaxHelath,
change to Float → In details ,Default value, current health as 80, maxhealth as 100
Create a eventgraph as follow: (SET node drag from Current health variable, click set)
image.png

Open Spike BP →Viewport → Details → Collision type change to OverlapAll
Select Spile Component → type tag → Add index, name as Trap
image.png
Add tag to 3rd person BP character too, name as Player
In spike BP, open event Graph, delete all 3 nodes and create as follow:
image.png

In PlayerUI BP, select the progress bar, create binding on Progress column
image.png
Change the binding name to PlayeHealth, Set the graph as follow:
image.png
Go to 3rd BP, click on Currenhealth variable, set default value as 100

Set Death condition (stand still) for character in 3rd person BP:

Modify new nodes as below (type less equal for node <=, character movement node drag from Component column):
image.png
In character movement node, change min analog walk speed to 0cm/s

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.