local attachment = HRP.RootAttachment
local LV = Instance.new("LinearVelocity")
LV.Attachment0 = attachment
LV.Parent = HRP
LV.MaxForce = -11000
LV.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
LV.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
local raycastparams = RaycastParams.new()
raycastparams.FilterType = Enum.RaycastFilterType.Exclude
raycastparams.FilterDescendantsInstances = {HRP}
local result = workspace:Raycast(HRP.Position, -HRP.CFrame.LookVector / 4, raycastparams)
if result ~= nil then
print(result.Distance)
local Distance = result.Distance - 1.5
if Distance < 0 then
Distance = 0
end
LV.VectorVelocity = -HRP.CFrame.LookVector * (Distance * 2)
else
LV.VectorVelocity = -HRP.CFrame.LookVector * 65
end
game:GetService("Debris"):AddItem(LV, 0.24)
It kinda of just pushes you in a random direction im so confused, i would love to use bodyvelocity but it literally does not work on my hrp no matter how high i make the values
External Media^ example