BodyForce is not working, Object just floats in air

I want to make the ball go to the hoop. But the ball just stays still and doesn’t move.

What I have done:
I have unanchored the hoop, i have checked the script and it still doesn’t work

local GoalPart = game.Workspace.Shot
local Basketball = game.Workspace.Basketball.Handle
local toolB = game.Workspace.Basketball

script.RemoteEvent.OnServerEvent:Connect(function(player)
	local mag = (GoalPart.Position - player.Character.HumanoidRootPart.Position).Magnitude
	local unit = (GoalPart.Position - player.Character.HumanoidRootPart.Position).Unit
	Basketball.BodyForce.Force = (unit * mag) + Vector3.new(0, 70, 0)
	Basketball.Anchored = false
	Basketball.Parent = game.Workspace
	toolB.Parent = game.Workspace
end)

I believe Body force is affected by gravity and mass too, so you’d have to do some math

example

local Speed = 100
local Mass = script.Parent:GetMass()

force = (Mass*workspace.Gravity)+Speed

what would the script look like then?

I suggest you use BodyVelocity instead, but if you still want to just use BodyForce then here,

function calculateForce(Direction,Speed,Mass)

local Force = (Mass*workspace.Gravity)+Speed

return Direction*Force

end

this function will give you the force needed to move an object using BodyForce or VectorForce

you can use it like this

local Ball = script.Parent
local BodyForce = Ball.Force
local Speed = 50

local Force = calculateForce(Ball.CFrame.LookVector,50,Ball:GetMass())

BodyForce.Force = Force