Consider the following code:
if jumpVector == nil then
jumpDist = (targetPos - ident:GetPivot().Position).Magnitude
local vector = (targetPos - ident:GetPivot().Position).Unit
jumpVector = Vector3.new(
vector.X * jumpDist * 10,
vector.Y * jumpDist * 10,
vector.Z * jumpDist * 10
)
end
targetPos is the Vector3 location of where I want the player to land. The problem is that there seems to be a non-linear component when calculating the force that’s needed to send the player to the destination point. The distance from the pad to the target plays a role, but there’s something else that’s missing. The constant 10 is arbitrary, but I think it needs to be replaced with a non-linear function. I’m not sure which one one. Any ideas?
Note: Force has been adjusted for mass and gravity.
EDIT:
I should probably mention that the jumpVector value is directly applied to the VectorForce.Force property.