Most accurate way to locate positions for the server

My issue is that I am trying to make a ground pound for my character similar to in Mario where if you are in the air and press the required button you will stay in mid air and do a little flip then smash to the ground. That part is irrelevant though as my real problem is that I don’t know how to get player locations accurately on the server. I first tried making this air checking system using Humanoid.GetState() but that wasn’t working how I wanted to. I then moved onto using ray-casts but that also was not working how I wanted to due to latency. I then tried Workspace:GetPartsInPart() but that is basically ray-casting just with a box instead. So now I have the question what is the most accurate way to relay client position while also being non-exploiter friendly. I do not mean for this to be an X Y problem or whatever it is called because this is genuinely helpful information, yet if you do have a solution that doesn’t solve my main question yet solves the mid-air checking problem I will be grateful for that too, thanks in advance.

TL;DR: What is the best way to tell if a player is a certain distance above any floors/parts/objects/etc, and what is the best way to relay players position from client to server while being exploit proof.

1 Like

For something like this you can probably trust the client and do most of the checks and calculations on the client. If they hit the right combo, start the animation on the client, send a request to the server to initiate the ‘smash’ and associated effects. In most cases it the difference probably wouldn’t even be noticeable. If an exploiter wanted to abuse it they already have client-side control over most of the character and inputs anyway, so there’s much easier ways of tricking your system than interfering that way.

As for the air checking system, raycasts seem like they’d be a good idea. You’d get precise measurements of the character above the ground, can send that to the server to dictate how far to “smash” (although a separate ray on the server might be a decent idea if there’s any small inconsistencies between server and client position).

1 Like

Thank you! I think I was overcomplicating it in my mind lol, I’m just gonna trust the client.

1 Like