Position obtained when i fire a remote event is different to the position on the client when the event was fired

When i fire a remote event, as soon as its fired i get the position on the server, but that position is a few studs behind what the actual position is on the client at that exact same time (gets worse with higher ping), i dont actually know whats causing this buts its annoying when trying to make magnitude checks in melee weapons, and is there any way to wait for the position to update to what it was when the remote event was fired for the client

is it maybe because of priorities on the server? and if so is ther any way to change them?

1 Like

can get some screenshots if necessary

1 Like

There is a small gap between when the server receives a RemoteEvent signal and the time that it is sent. You will need to add some leeway in between. Upon testing I found that there is around a 0.03 second delay between the fire and the received event.

Record a timeline of positions and use it to see if the distance is valid at the time it was sent

Will try this thank you, if it doesnt work ill send screenshots :smirk:

1 Like

How would i go about makikng this

1 Like

Record positions into a table, use the time that you received the remote - player ping to index it’s closest match and then verify

im not sure if this is what im trying to achieve, i will send some screenshots of what i mean

1 Like

Okay so when I fire the event whilst im moving, this is the position of my humanoidrootpart to client:
image

But at the same time on the event i get the humanoidrootparts position from the server
image

from the direction im moving, this is behind where i was on the client when i fired the event, does the server receive and do stuff with remote events before updating the characters position, and is there a way to wait for the server to get the updated position, to make it so the characters position is updated first? Because its currently processing the remote event wayy before it processes that the character has moved close enough for the magnitude check to be successful

this might not make sense but yeh
( i dont want to just use a wait because that isnt reliable because the delay between is dependent on the ping & it sometimes shows you dealing damage a decent amount of time after you hit them to the players), and if i check multiple times then it will still sometimes show the damage delay, games like https://www.roblox.com/games/4169490976/Mortem-Metallum-Alpha seem to be able to do this somehow

1 Like

I dont understand what your asking… for melee weapons I would do the damage immediately on the client and then wait for the server to respond whether or not its valid

but the server doesnt think its valid because the position of the character when the remote event is fired is behind where it is to the client to the server, i am asking if theres a way to accurately wait for the server to catch up to the characters position when the event was fired without using wait()s before checking if the character is too far away to hit (with the magnitude check)

1 Like

try game:GetService("RunService").Heartbeat:Wait()

nvm i fixed this by checking the position repeatedly

1 Like

update on this i couldnt find an actual fix, roblox replicates character position around 16ms slower still, the fix i use is to just make the checks on the server bigger if you are moving to compensate for the delay

oh and yeah mortem metallum does that too they dont have some magical fix