Need help to optimize my shooting system

I am working on a side scroller shooter and i need help to optimize my shooting system because this one use too much bandwidth provoking lag online. The first part is local and i call replicate event for spawning bullet.

New try, someone can help ?

Hi, I’m not seeing any problem in your logic above concerning network bandwidth. Ofc if you call the SpawnProjectileServer very often (e. g. some weapon that fires with very high frequency), and use the same logic for your bots, consider sending one event when the bot starts shooting and one when he ends shooting instead of sending every single shot through the RPC.

To see where your network bandwidth is going you can use the network profiler Network Profiler | Unreal Engine Documentation
and also keep in mind that by default UE caps at something like 5 kilobytes per second (so if you see in the network profiler that you’re above that limit, either optimize what’s costing you most of your bandwidth and can be optimized or increase the limit).