I think @kleptonaut may hold the key to the lock I’m trying to pick here…
-
What do you want to achieve? Keep it simple and clear!
I’m currently working on a lag compensation script that will predict on the server where a part controlled by a player is on their client. -
What is the issue? Include enough details if possible!
My issue is that I do not understand how ‘AssemblyLinearVelocity’ correlates to how a part will move next tick/physics update. -
What solutions have you thought of so far?
Refer to the image below.
Independent Variables:
Dark Green - The root part’s CFrame in the previous heartbeat on the server
Bright Green - The root part’s current CFrame on the server
Blue - The root part’s current CFrame on the client
Dependant Variables:
Dark Orange - The inverse object space between Dark Green and Bright Green applied to Bright Green, calculated asHRP.CFrame * HRP.CFrame:ToObjectSpace(lastTickValue.CFrame):Inverse()
Bright Orange - Dark Orange but corrected for the time between the cached CFrame’s time and the time on the client, calculated asHRP.CFrame * HRP.CFrame:ToObjectSpace(HRP.CFrame:Lerp(lastTickValue.CFrame, clientTime - lastTickValue.Time)):Inverse()
Yellow - Bright Orange but withHRP.AssemblyLinearVelocity.Unit
added on to it.