Damage system health Bug

Hey, Recently I have been experimenting with a system that I used back in Unreal 4 but does not seem to be working in Unreal 5. The Issue comes after the raycast when the hit is detected it subtracted a number(weapon Damage). For some reason the number will go negative and only be one shot.

I will include the code that I have below, if anyone could help me, that would be amazing!

Ray cast system:

Server Damage update class:

image

Update Health Class:

image

Event damage system:

Event Any Damage → “Current Health” - Damage.

You currently have it inversed… Damage - current health.


This all should be happening on the server and player health stored in Player State.

Example (projectile system).

Srv projectile hits, calcs damage and applies.

Event Point && Radial Damage execute on the character.
Note these events only exist and execute on the server.

Each calls the Srv Take Damage event which passes the dmg value (float) to the player state and sets a display health float (rep notify).

The Display Health's OnRep function updates the UI health value.