Obtaining client position without remote traffic?

Hey, and thanks for reading in advance.

In a class-based fighting game I’m helping to code, a few classes employ the use of dashing attacks - moves that rapidly create hitboxes as the player travels at moderate velocity.

The trouble with this is getting the hitboxes in the correct position. The system we currently have in place simply pings a remote every step of the dash to determine position, but you can imagine how this ends up failing - signal travel time causes hitboxes to appear very late or out of sync. I’m attempting to re-imagine the system a little and cut out the remote traffic entirely and simply have the server decide where to position each box without asking the client for information, but I’m having a little trouble:

Even if I perform the physics of the dash from the server, the server is sluggish and isn’t in proper agreement with the client about where you ‘are’ per se.

Is there any method to obtaining the client’s idea of your own position without using a remote and waiting for a callback? Should I just calculate the best fit by using ping to correct? Any help or advice is appreciated.

1 Like

If I get it straight you need to find the position of the player so that you can position a hotbox around them? Couldn’t you just weld the hotbox to their HumanoidRootPart.

You can also still obtain the clients character’s position from the server.

You can also still obtain the clients character’s position from the server.

How so?

Just the same as a local script, once you know the player just do:

print(player.Character.HumanoidRootPart.Position)

I don’t think you’re following here - the client’s idea of your position and the server’s do not match. To be more specific, the server updates your position a few fractions of a second after you’ve actually moved - it’s not synced up to the client.