Best way to handle bullet logic and hit detection?

I recently been developing a gun system using FastCastRedux for more realistic bullet ballistics, but it seem that due to all the gun logic being server-side with the client only handling the input using remotes, theres a very noticable delay between the mouse click and the bullet actually firing, i played some other roblox FPS shooters and dont see that, the gun fires instantly after the mouse is clicked.

what are some methods that people use to reduce latency while also avoiding pontential exploiting.

There’s really no way to have the best of both worlds; it’s a battle of tradeoffs.

That being said, virtually any tool that relies on client input can be exploited. I don’t think it’s worth sacrificing the playability for all players to minimalize the damage of a select few, malicious users.

Do you know any common methods?

Ok so after some looking around i found that a good method is to handle bullet trajectory and hit detection on the client, and have the server be responsible for verifying and dealing damage if it did hit.

The only question now is how do you exactly verify that a hit is legit?

1 Like

From my understanding, that is how bullet/gun systems are normally handled.

Unfortunately, like I said in my previous reply, there is no way to create a system that can verify legitimate hits with 100% certainty because the initiation and data of the event are created on the client side. This information can be easily manipulated by the client, and you have no control over this.

It’s probably best to go with the implementation you just suggested and have a good moderation team to catch any potential cheaters.

1 Like

I have this same question.

Would it work to have a ray fire on the client, then if said ray hits, it would fire to the server and the server would verify by magnitude to verify if the ray is anywhere near the clients rayhit?