top of page
Half-Health Damage Effect
Scripting Explained
Half Damage Check
These occur inside the player-character blueprint after the UE5 built-in Event Point Damage. It checks if the player's health is above or below half, and then it ensures the effect isn't already running. If the player has crossed below half health for the first time, the Multi_HalfLifeFX will run on all the clients in-game so all the players will see the effect. This includes the owner of the character the event occurred on.
Half-Life Effect multicast and DMIs
The Multi_HalfLifeFX event sets a scalar parameter to 1 on multiple meshes associated with the character, turning on a fresnel effect. The ability to change parameters is possible through Dynamic Material Instances. I created them on the Construction Script of the Character Blueprint. There are three, one for the third-person mesh that the other players see, and hands and torso that only the owner sees.
Half-life material function
This is the inside of a Material Function created by JakubPander. I adjusted the effect color, and through the DMI in the previous slide, I accessed the Fresnel Parameter. Instead of a Static Switch, I created a Linear Interpolation node to determine whether the effect was on or off. This allows me to fade in the effect with a Timeline function if I choose to later. A value of 0 turns off the effect, and 1 turns it completely on. In the material, I added this to a separate dissolve effect used when the character is despawned. I then connected the effects to the emissive output.
bottom of page