Client Or Server for melee detection?

So I am currently trying to make a melee system but I am not sure if I should do the hit detection via client or server. At first I assumed server to be the best but I here a lot of well;
when swinging with a weapon on the client you’re target could be closer or in swing radius where as on the server they are much farther away due to ping and lag and blah blah blah you get it.

So client or server for melee hit detection?

2 Likes

I do a lot of hit detections on the server.

How would you actually verify the client isn’t lying that they hit the player? How would you make sure they can’t just spam the damage event? What about the perspective of the other client?

If you can’t answer these questions, server is definitely the way to go. Just use less performant hitboxes such as a raycast hitbox module.

1 Like

Depends, Server is overall more secure bc on clients you can exploit client sided detections but ig for performance wise client is better.