Predict Future Position based on AssemblyLinearVelocity?

Howdy,

I need to compensate for physics related lag client-side so server-side hit detection between a Player and a Ball “looks” consistant to the player.

One solution is to predict the future position of the Ball on the Client, and advance it’s position accordingly, so as to bring it more in line with the actual position on the Server.

I’ve searched the forms and did some Googling and came up with this, but it just shoots the ball straight up into the sky. Halp!!

Local Script:

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local Player = Players.LocalPlayer
local Ball = script.Parent

local LagTime = 0.1 --Player.GetNetworkPing()

RunService.Heartbeat:Connect(function(DeltaTime)
	
	Ball.Position = Ball.Position + Ball.AssemblyLinearVelocity * LagTime
	
end)