I can't damage other clients when I shoot them, only when I use the "server client"
I am able to damage the players when I am running on a server client, but I can't do any damage when I am on another regular client. I have a damage node running on the server when I overlap my projectile and every player has it's own health. Everything is working except the damaging part from client to client. I know that damage has to go through the server first, I just don't get how to make it go from client to server to client when I hit another player.
edit: I got server to client and client to server working which is ok if I dont use a dedicated server and only 2 people play, but I need to get it to go from client to client. I got it to work my having everything run on the server except for spawning the projectile (which would mess up the aim) and damage now goes both ways. Still need help to have this work for all three interactions at the same time though. (client->server, server->client, client->client)
It looks like in your original post that you have clients doing a multicast to themselves which then calls the server. That's a little backwards - it would make more sense to RPC from client to Server first, then Multicast from server to everyone else.
But I think you're making this harder than it needs to be. If you call the built in ApplyDamage function, it will execute on the server, and you can reduce the Health in the PlayerState for that player, and have that health variable be replicated so all the Clients know the health was reduces, without having to Multicast anything.
Basic rule is if you want something to change for everyone, Make it a replicated variable on a replicated actor, and change it on the server. if you need certain actions to happen on all the other clients, and not just the variables change, then you repnotify the variable or multicast, depending on how you want it to handle relevancy and whether it has to be a blocking, immediate response, and whether it needs to be reliable.
answered May 18 '18 at 07:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here