LinearVelocity isn't working for me

So in my script I add a linearvelocity so whenever a player is hit by a move it gets the origin which is the attackers position, then it gets the goal position which is the player. After getting these 2 vector3 positions it converts it into a cframe like this:

local direction = CFrame.new(origin, goal).LookVector

After doing this, I add the LinearVelocity’s VectorVelocity to the direction like this:

LinearVelocity.VectorVelocity = direction * 50 -- range of how fast they go

For bodyvelocities this works fine. But for LinearVelocity it isn’t working. I set RelativeTo to ‘Attachment0’, and added one in and connected it to the LinearVelocity. The velocity does push the player it just doesn’t push the player in the direction I want it to as described above.

What’s wrong with it? I’ve been working for hours tweaking it trying to figure out why it’s not doing what I want and I can’t seem to figure it out. I tried setting an origin of Vector3.new(0,0,0), I tried setting the origin to the attachment’s worldcframe. None of this works.

Just to make sure, you added an Attachment to the players part and then you set the Attachment0 of the LinearVelocity equal to that attachment?

Yeah I parented the attachment into the player’s humanoidrootpart, then I set the linearvelocities attachment0 property to the humanoidrootpart.

Oh forgot one thing…to move a player make sure your MaxForce is at least 5000. Usually I just set it to math.huge.

I did that as well here’s the bit where I set all of it’s properties:

local VelocityMover = Root:FindFirstChild("VelocityForce") or Instance.new("LinearVelocity")
	VelocityMover.Enabled = false
	VelocityMover.Name = "VelocityForce"
	VelocityMover.MaxForce = math.huge
	VelocityMover.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
	VelocityMover.Attachment0 = BodyAdjuster
	VelocityMover.Parent = Root

BodyAdjuster (Attachment)

local BodyAdjuster = Root:FindFirstChild("BodyAdjuster") or Instance.new("Attachment")
	BodyAdjuster.Name = "BodyAdjuster"
	BodyAdjuster.Parent = Root
	BodyAdjuster.Position = Vector3.new(0,0,0)

Okay I see what you mean. I had more success with this maybe it will help you:

local direction = CFrame.lookAt(origin, goal)*CFrame.new(0, 0, -(origin.Position - goal.Position).Magnitude*50)

Oh I also got rid of the RelativeTo and changed this line:

LinearVelocity.VectorVelocity = direction.Position