Hi, well the title says it all; should I send a raycast from the client (and then try to verify as much as possible on the server) or just detect input (position, mouseHit) and then do the raycast on the server?
For a casual “shooting” game (not like phantom forces etc.) should I raycast on the server or still on the client?
Also, the game will have around 10 players, so not many.
It’s quite close combat, the furthest wizard wand (I am making a wizard style game) goes around 500 studs. (the map is not larger than 500 studs in diameter…)
Sadly, I don’t think you can do any verifications on the server other than ammo and RPM verifications, other verifications will just be too expensive for the server.
It is just unfortunate that server-side raycasts are expensive. While client-side raycasts provide good user experience, they subject your game to exploiters. Server-side raycasts provide bad user experience while making it impossible for an exploiter to shoot through walls.
Do both use Server events but listen if you do it to the way where the server makes parts in a folder and the client visulaizes those parts and the server can check the positon of the servers line of the raycast and the clients line of the raycast if the line is different than the server can ban clients for hacking as the inital raycast should be the same as the client ray cast
Wouldn’t it hit in different places every time? As the raycast on the server side will only be created a few split seconds later and if the character is moving or the mouse is moving then the position will be different.
Hey so basically what i was trying to explain is
Raycasting on both the client and server side to prevent cheating And also measure the lag from the server to add some exception as the server and client raycasts will always be somewhat different so adding some leeway or space for error helps to not kick innocent players. Hope this helps