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)
Is the TakeDamage event being executed?
the custom even is being executed. That’s what the print string is for, checking if it runs or not.
Hi, if your health bars connected to the replicated variables, which they should, you need to change that variable on the server in order for a client to see changes. You should also have all damaging logic on a server only, and tell clients about results.
Did you change your code significantly? If so post an updated version.
They are being seen when changed, I have damaging logic on the server now, only problem is now clients cant damage other clients. Is there a way to fix this?
nvm I tried to make it work and by doing so messed everything up. Back to square one again
I am now at a point where the clients deal damage to themselves, not the other client. how would I change this?
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.