Download

Cast to changes variable for all players

Why this event happens both on server and client?
It should affects only that hit component.
This is very strange, event “kill” enables physics, and it works well, it only affects player, that hit. But if i try change variable for specyfic player using both kill and print event it affects everyone! How can i fix this?

Hi,

what do you want to do?
[HR][/HR]
If you do multiplayer both server and all clients locally run a simulation of the game and you use replication to try to keep it in sync (or as far that the player doesn’t have the feeling that something is wrong). Since they all run their own simulation, you should expect Hit events to be triggered indepentently on server and clients.

In the Hit event you’re calling a multicast which will be executed on all if the server is calling it and executed on that client if a client calls it. Therefore if the Hit event eventually triggers on the server and all clients, then you would execute the multicast event once on the server and twice on every client. The print is just a non replicated event so it will execute on everyone that calls it, so wherever the hit happens (in your case it apparently happens on server and client, therefore they both call the event. The DoOnce there won’t change that, since it’s only executing once (once on server and once on client)).

Also the print you’re seeing there happens on both server and client, but on the (essentially) same character. Once on the server version of it and once on the client version of it (which are essentially the same, you would try to keep them in sync via replication as much as necessary). So it is not happening once on the “server player character” and once on the “client player character” but on the same character once on the server version of it and once on the client version.