PSA to any future readers. You Do Not Replicate Projectiles.
First off you should be working with Object Pooling for projectiles. Very easy to do in BP.
You need 3 projectile classes.
One for each proxy (Autonomous [client], Simulated, Authority [server])
Clients projectile is setup to only do impact fx on hit.
Component setup is as follows.
Mesh here has no collision. It’s used for visual effect like a tracer.
Hit FX are handled by the Bullet Pool actor component.
On hit he pass hit data to a function in the pool, then send the projectile back to the pool.
Client projectiles and shooting in general is 100% responsive and FX based.
Server projectile
This projectile only ever lives on the server. It handles damage.
It’s On Hit event is identical to clients in the way that we are calling Projectile Hit Manager
in the bullet pool, yet the servers pool functions are overwritten with specific processing.
On the client/sim it just does decals, squibs, sound. On the server it calcs and applies damage. No FX are done.
Sim Projectiles
These have an audio component to allow for flyby audio. For when a projectile is close enough you can hear it whizz.
It calls back to the same bullet pool class as clients do so it has the same logic. Just decals etc.
Servers…
End of day the server is only broadcasting 2 vectors to sims in a multicast.
Muzzle location, projectile velocity
With these 2 vectors sims can request a projectile from its pool, tell it where to teleport to and what velocity to apply to the projectile.
Client fires local only shot, then RPC server to shoot
Server shoots using its own calculated values. Then Multicasts two vectors to Sims.
Sims use those vectors to shoot in their simulation (other players screens).