Apply Damages doesn't trigger the AnyDamages Event for Client

Hi !

I’m a game designer student and i got a tiny problem, i’m creating a third person shooter and when i shot, it creates a linetrace that block on player, once it block the player, it fire “Apply Damages”, the thing is that it works perfectly for server side (obviously) but not for client side, i’m searching for hours and i’m a bit depressed ahah. Can you help me to trigger it for the client side ?

Here are few screens :

I forgot to plug the damage pin for the screen but it still doesn’t work

(Sorry for my english)
Thank you for your help !

damage is only server side, health change is replicated to the clients, so you can make it rep notify react on clients.

So, i only have to change the variable to RepNotify ?

Edit :It still doesn’t work, i tried few thing, i’m sure i’m missing a stupid thing x)

You should call your damage method (with the line trace call) to run only on the server.

For that you can create a Custom Event node and mark it to run on the server.

The variable could be just a replicated one or RepNotify if you need to do something else when it changes on the client.

I did, it still doesn’t work, anyway thanks for taking time to help me ! :slight_smile:

Did you mark the Health variable to replicate?

Yup, “Health” is set on replicated

The weird thing is that when i shot myself (by setting “ignore self” on false) it works, but i can’t kill server player or any other client player.

The killing should be server-side too, so it can replicate it on the clients, so that is right.

Does your “Print String” happens? Is it calling the “Apply Damage” event (putting a breakpoint on the node)?

And what does not work? The Health or the Destroy event? Or neither?

Well, without looking at the whole picture, multiplayer stuff is kinda hard to guess what’s wrong without some testing. Have you looked at the multiplayer blueprint tutorial from Epic on youtube? If I remember it shows some damaging structure you could use to make yours.

Another thing to look at later is to put all the target logic on the server (including the trace), so you can’t cheat and send the actor and damage on the client without actually target them.

Destroy and health doesn’t work, it only works if i shot myself. The “Die” function is on server too.

I downloaded the multiplayer shoot project from epic to check the blueprints, but i don’t see what’s wrong, maybe can i can pm you the projet ?

My trace is on server too

Sure, I can look at it later tonight.

Problem Solved, thanks to Mielke ! :slight_smile:

Hey Crysux, what did you do to solve your problem because i’m in the same boat.

[=“Crysux, post:11, topic:51646”]

Problem Solved, thanks to Mielke ! :slight_smile:

How did you solved it?

[=“Crysux, post:11, topic:51646”]

Problem Solved, thanks to Mielke ! :slight_smile:

Please share?

Same here. Cannot get it working for some reason. Please reply if possible what steps did you take in order to resolve it.