So basically, I’m making an FPS game but I don’t know whether to make the raycasting on the server or client, with the server it makes it impossible to shoot through walls etc, but comes with input delay / server lag and with the client its easily cheatable but with way less lag for the server and player.
I know that if I made the raycasting on the client I could do sanity checks but I don’t know how do to that.
You want to negate errors with internet latency, so you should be cutting the middle man and let server do the work now. Server shoots the raycast, while player locally plays their gun animations and such. (Server plays animation that doesnt automatically replicate, like player animations using :LoadAnimation ()
You do it on both.
You can raycast on the client, and only if you get a hit on the client, send an event to the server
then the server can do its own check.