How to convert a bodyvelocity to vectorforce?

I am trying to handle knockback for an explosion, but am running into a problem.

I want to switch the knockback from using bodyvelocity to vectorforce, as bodyvelocity is deprecated and could break at any moment. The problem is that it doesn’t work.

My sad attempt at vector Force implementation:

local directionVector = (torsos.Parent.HumanoidRootPart.Position - explosion.Position).unit
local velocity = directionVector * 100
						
-- WHY THIS NO WORK?!!!!!!!11!! >:(
						
local A0 = Instance.new("Attachment")
A0.Parent = torsos.Parent.HumanoidRootPart
						
local vf = Instance.new("VectorForce")
vf.Parent = torsos.Parent.HumanoidRootPart
vf.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
vf.ApplyAtCenterOfMass = true
vf.Force = velocity
vf.Attachment0 = A0
						
game:GetService("Debris"):AddItem(vf, 0.3)

Versus my Body Velocity implementation:

local directionVector = (torsos.Parent.HumanoidRootPart.Position - explosion.Position).unit
local velocity = directionVector * 100

local bv = Instance.new("BodyVelocity")
bv.Parent = torsos.Parent.HumanoidRootPart
bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
bv.Velocity = velocity
						
game:GetService("Debris"):AddItem(bv, 0.3)

Am I handling the attachment wrong? Or do I need to compensate for something new in vector force?

I wouldn’t use vector force due to the fact that it was not intended to replace body velocity, what I would use is LinearVelocity which was meant to replace body velocity (but still doesn’t has some of its capabilities) its the best option to choose to switching.

tried it, still doesn’t work, what am I screwing up?

local directionVector = (torsos.Parent.HumanoidRootPart.Position - explosion.Position).unit
local velocity = directionVector * 100
						
local A0 = Instance.new("Attachment")
A0.Parent = torsos.Parent.HumanoidRootPart
						
local lv = Instance.new("LinearVelocity")
lv.Parent = torsos.Parent.HumanoidRootPart
lv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
lv.VectorVelocity = velocity
lv.Attachment0 = A0
						
game:GetService("Debris"):AddItem(lv, 0.3)

Wait nevermind I was using a vector3 to set the max force instead of an integer, now its working! Thanks :heart: