Verifying a client sided raycast on the server

How would i verify a client sided raycast on the server?

By raycasting on the server again? Can you provide more info on what you’re trying to achieve?

you don’t?
there is no way to have the server verify anything the client sends. it all can be spoofed by the client, regardless of any checks you implement.
if you’re making some kind of gun system, or anything that’s utilising raycasts for gameplay, just put it on the server. client should only use a raycast for the visual and not be actual detection.

If you are making something like a gun, you would have to use lag compensation techniques to correct for the ping before trying to simulate a verification raycast. Valve made an article about this: Source Multiplayer Networking - Valve Developer Community

It is a bit complex, but that’s the only way to verify it accurately.

3 Likes