Make Apply Damage node replicate?

so i’m very new to UE4 and i know that a multiplayer game isnt the best place to start, but i don’t really have any drive for a single player game. Anyways, i’m making a shooter and long story short, is there any way to make the node “Apply Damage” replicate? i have everything set up, the only problem is that the server can give damage to the client but a client can’t give damage to the server.

ApplyDamage is run on server per default because it is a pretty important gameplay mechanic. Such things shouldn’t be done by any clients. You should replicate your health variable instead and then it should work.

hm… it is replicated but it doesnt seem to work

i have a print string to show the player’s health, but it only pops when the server shoots the client, not vise versa.

Does the client perhaps need to ask the server to inflict damage or should that not be a problem?

Hmmm can’t see where might be the problem without seeing your nodes.



let me know if this isnt enough info or if i’m just completely clueless LOL

but yeah,
the server can damage the client, but client can’t damage server. let me know what you think.

the pics kinda seem to be backwards btw

I’m confused by the SwitchHasAuthority node in StartFire. StartFire is only be called within Server_StartFire? If so, SwitchHasAuthority will never execute the remote part. And even if not, this looks a little strange to me. I don’t know if you intend what’s happening there.

Anyway, this isn’t your problem I think. Can you show what you’ve plugged into Start and End of your trace? Are you using nodes like GetPlayerController or GetPlayerCharacter there? If so, I think I know why this is not working as intended. Those would always return the server’s Character / Controller. That would explain your problem.

yeah im not sure about the authority thing either tbh, i basically followed a tutorial series to get the basic layout of the game, then i added what i needed for an online game (main menu and find/host game) and such, so a lot of stuff in here is not mine really. but here is the entire trace graph. Thank you for helping by the way! would it be a problem if the 2 players are using the same character BP? i would assume not since everything but damage has worked so far. Anyways here’s the stuff and thanks again!


To be honest, I’m a little clueless, too. How are you setting your OwningPawn variable? You don’t set it with a GetPlayerCharacter node within a RunOnServer event, do you?

this is what i have for set owning pawn


i must have followed the wrong tutorial if even you are clueless haha! but yeah like i said, everything works great so far besides a client damaging the server so i’m not sure what’s up

this is where that function is used, it’s in my character BP for giving default weapons

Your Set Owning Pawn function looks familiar… I think I have seen this tutorial as well.

haha any idea what i should do? i posted my question in a facebook group and they said instead of using Apply Damage, make my own damage event.