Matgarciaz
(Matgarciaz)
September 28, 2020, 1:07am
4
BrUnO XaVIeR:
Welcome to multiplayer nightmare…
You should take socket location from client side instead, and pass that location to the server to fire the raycast.
Your sockets rotation/location on server are not exactly replicated.
But then… what if a cheater makes the socket always point to enemy head? Well, good luck
anonymous_user_b81e37271:
You need to look into a technique called lag compensation to solve this. It’s standard in pretty much every FPS. If you google it, the top result should give you a pretty good idea of what you need to do. Basically the idea is that you need to rewind time on the server so that it sees the same things the client did when it took the shot. Then you can do an authoritative hit scan on the server without any risk of hackers spoofing positions.
Thank you guys for the guidance! I’ll definitely do some research on this. Im very interested in lag compensation. But I don’t think I fully understand multiplayer yet to be able to do this but im down for the challenge.