How should I handle projectiles for tools (rocket launcher, shotgun, flamethrower, etc.)?

TL;DR: I’m looking for a simple, reliable way to handle different kinds of projectile weapons — rockets, flames, bullets, etc. — that feels responsive, replicates well, and won’t turn into a huge mess to maintain.

Hey everyone,

I’m making a game with a bunch of different weapons (all Roblox Tools) — rocket launchers, shotguns, flamethrowers, grenades, and probably a few more weird ones later on.

I’ve already got the melee weapons figured out, but the projectile weapons are holding me up.

Since all of these projectile weapons are so different from each other — some will shoot big, slow rockets, others will spray flames, and things like the shotgun will fire a bunch of pellets — I’m struggling to find one good way to handle them all.

What I’m aiming for:

  • When you fire, it feels snappy on the client (no weird delay)
  • Projectiles replicate to everyone so all players see them right away
  • The system stays somewhat optimized (about 15 players in a server)
  • And MOST importantly, it’s SIMPLE and easy to maintain

I’ve looked at a bunch of methods online, but every one of them either:

  • Feels way too complicated
  • Has some big flaw or limitation
  • Or just seems like there’s too much that can go wrong

I don’t mind making my own system from scratch — I just need some direction.

  • Should the client spawn the projectile first and then tell the server to replicate it?
  • Or should the server create everything (and risk it feeling a bit laggy)?
  • How would you handle hit detection for very different weapons like rockets vs. flames?

Any advice or examples would be hugely appreciated. Even a quick rundown of what’s worked for you would help a ton.

Thanks!

EDIT: Since the types projectiles are so different, there will be a separate system for each type of projectile. Flames will get there own, bullets will get their own, etc.

Client creates bullet, will detect when it hits and also tells server that he is firing
Server will tell other clients to also create the bullet vfx and that stuff
when 1st client detects hit, server will see if the hit is valid

In my opinion, the server should create the projectile and set network ownership to the client that fires it if necessary to reduce lag.
To prevent the projectile from phasing through the wall because physics. (dw, roblox literally made a breakthrough in physics, AVBD, last month at SIGGRAPH. Might take them a while to put it into roblox, but I think it might actually be viable to do physics projectiles now) you can implement a raycast or blockast every few server frames to make sure it didn’t go through walls.

if you don’t want to get into crazy math and creating new bicycle just use open source modules like FastCast

bruh the post really is 2 months old