Raycasting, local or server for upto 200 players

Hey guys! I’m pretty split on whether i should raycast client-side or server-side. Client-side comes with the benefits of responsiveness, but can be easily exploited. Aswell as this, i wouldn’t be able to script other people seeing others bullets (i’m not at that point to do that). Server-side would be a lot less exploitable, you can see others bullets but i’m worried about possible server lag. My friend has said that even with all this stuff and the bullets it wouldn’t lag however i think it may cause some. Could anyone please advise me if it would?

For all those people I recommend making it local, especially since you’re creating projectiles which imply that they are long rays which can take a lot of memory especially if many of them are made.
I’d say to let the client fire a remote event to tell the hits to the server. As you said it can be exploited, but it’s better to have 2-3 exploiters every while than having all players play with possibly a lot of lag. Do checks server-side, see if the bullet could’ve actually hit the target (example, if the target is far from the bullet of 20-30 studs then it’s probably an exploited bullet, so don’t deal damage/effects). You also have to account laggy players, so you might have to test many times for many possible situations.

2 Likes