It’s not an efficient way of replicating things. Don’t use RPC NetMutlicast, especially Reliable NetMulticast if you can avoid them. OnComponentBeginOverlap will be triggered on the server when an actor hits your capsule, so (1) is not needed and it can make security issues if a bad client calls this server RPC with external tools, so you can delete that.
(2) This should be just a function, but not an RPC, and since you used Switch Has Authority before, you know that this function will be executed only on server. Now use Replicated Variables w/ RepNotify instead of NetMulticast RPCs! I don’t know what you’re trying to achieve, but if you are the server and you set a Replicated Variable to another value, the new value will be sent to all clients, and with RepNotify you can do what you want when this value is changed, for example you can change a PointLight color or, I don’t know, make all players jump , it depends on you.
This is the most efficient way to replicate things relevant for the gameplay without making a huge lag.
I hope I was clear, I’m not very good at explaining things so if you have any questions, feel free to ask!
1 Like