ClientSide Projectile(s)

I’m working on a new projectile system that will need to work ClientSided, this is due to parts of the Map being loaded on the Client as opposed to the server and the ‘Projectiles’ will therefore need to detect these in-order to create a ‘hit’ effect.

I’m playing with the idea of using :FireAllClients, however, surely if I do this, combined with RemoteEvents, then the Event will fire by how many Players are on the server.

So, if Player1 fires the Projectile - :FireAllClients will fire the projectile for Player2, Player3 and Player4 - However, if Player1, Player2, Player3 and Player4s projectile hits a target, it’ll repeat the process x4 times despite it being the “same projectile”.

Ideas on this?

1 Like

Ideally a structure would look like:
Client Shoot FireServer
Client Creates Graphical Projectile (for feedback reasons this should feel instant so should happen instantly)
Server does sanity checks and creates a virtual projectile for collision detection
Server FireAllClient for graphical projectiles
Server detects hit FireAllClient for graphical projectile removal.

1 Like

So from Step 2 > Step 3.
I assume I’ll be creating a pseudo Projectile ((Client sided)) and a legitimate Projectile ((Server Sided));
How could I allow for the Pseudo // Visual projectile to mimic the speed & movement of the Server projectile to allow for accurate hit detection // removal?

EDIT://
Following from this idea, with the ‘Server Projectile’ still being the authentic method of detection, this wouldn’t detect Client loaded objects?

Correct, this would not detect client loaded objects.

And that question you asked is one of the biggest problems in distributed computing. Many games have had the same issue. Ideally you take a note of the time stamp and the velocity of the projectile and the launch position, from there you can use math with the time the signal is received to adjust the initial positions. This should hopefully allow every other instance to be a relatively close mimic. Time synchronization is difficult.