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
Open 3rd person BP, create nodes as bellow:
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)
Open Spike BP →Viewport → Details → Collision type change to OverlapAll
Select Spile Component → type tag → Add index, name as Trap
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:
In PlayerUI BP, select the progress bar, create binding on Progress column
Change the binding name to PlayeHealth, Set the graph as follow: 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):
In character movement node, change min analog walk speed to 0cm/s