Where should I preform melee hit detection?

This has been a question thats been on my mind for a while, and now Im here to ask.

Should I do melee hit detection via the client or server?


Now before you say it, yes Im aware exploiters can just change the hit items to the server, of which on said server can just verify they are in a certain range of the player and problem solved (Unless the exploiter teleports to them, but thats a whole other can of worms).

Now if it was on the client, the sync might be a little silly, but on the plus side, it’ll probably be more performant as the server doesnt have to do the hit detections.


tl;dr should I do melee hit detection on the server or client?

1 Like

Making it on a client is less resource heavy and you can simply do sanity check on server.All depends on game yet again/kick player if it fires too much remotes while being on debounce still (although be careful becouse it may be out of sync with server’s debounce)
Also it could be mega vulnerable to aimbots unless you do a very good sanity check like checking character’s dot look position angle.
I see a very good potential for sword fighting game if you want a “realistic sword hitbox” on raycasts with swinging then yeah probably worth keeping it on a client and validation on server.

1 Like