Download

Network shooting question

Okay, the answer probably is simple, but still. Let’s say we have simple multiplayer shooter, each player has a weapon which spawns projectiles. The logic is: LMB -> triggers Fire event -> it calls for Server fire event -> which calls Multicast fire event with actual projectile spawn. The question is, what is the common way to exclude shooting player itself from multicast, so he will not feel the lag and will be shooting his own projectiles instead.

Hello,
I am still in the process of learning the engine so I may be wrong, but I guess you would have to add an input pin to your event holding the ref to the actor firing it so you can later exclude him from the checks. E.g.: If you are using MulticastLineTrace you’ll see the input-pin for an array of actors to exclude.

All spawning happens on the server. Do not spawn individually on clients. The logic is to spawn once on the server. The spawned actor is set to replicate. The server replicates changes out to all the clients. The server is the boss and don’t you forget it.