Body position boomeranging

Hi. While scripting a knockback mechanism for my combat system, I encountered a glitch. Whenever the body position for the knockback is applied to the player, they glitch back a couple studs before the body position ends.

Script:
(Local root = root of player that is attacking,
Enemy root = root of player getting attacked/knocked back)

local bodyPosition = Instance.new("BodyPosition")
bodyPosition.Parent = enemyRoot
bodyPosition.MaxForce = Vector3.new(math.huge, 0, math.huge)
bodyPosition.Position = localRoot.Position + localRoot.CFrame.LookVector * 30
bodyPosition.P = 9999
bodyPosition.D = 1000

Video:

I think you should use BasePart.Velocity instead, try this:

enemyRoot.Velocity = localRoot.Position + localRoot.CFrame.LookVector * 30

I think it’s supposed to be smoother and less glitchy. Might be wrong tho.

Change your P and D values to tune the movement.