Knockback relative to attacker

After body movers were removed I had to attempt to learn how to use the other movers.
I’m still very unfamiliar with them and can’t seem to figure out how to make this knockback relative to the attacker.

               hit.Parent.Humanoid:TakeDamage(12.5)
				local A = Instance.new("Attachment")
				A.Parent = hit.Parent.HumanoidRootPart
				A.Name = "DashAttach"
				A.Axis = Vector3.new(1,0,0)
				A.SecondaryAxis = Vector3.new(0,0,-1)
				--linear velocity is on plane relative to attachment 0 max force 11000
--I tried to make it relative to attachment 1 and make attachment 1 part of my character then apply the force but it moves the attacker and the attacked			

				local V = script.LinearVelocity:Clone()
				V.Parent = hit.Parent.HumanoidRootPart
				V.Enabled = true
				V.Attachment0 = A
				V.PlaneVelocity = Vector2.new(0,-250)


				local hitsfx = script.Hit:Clone()
				hitsfx.Parent = hit.Parent.Torso
				hitsfx:Play()
				wait(.5)
				V:Destroy()
				A:Destroy()
				hitsfx:Destroy()


Somewhat hard to see but the first kick the character gets pushed into mine and on the second he gets knocked in the correct direction.

Not even sure if I’m using the right type of velocity so feel free to pick at the script

1 Like

New movers work similar just use attachments instead of baseparts, and have more functionlity, mathematically this issue would of applied to the legacy movers aswell

To make it relative you simply get the direction of where the character looking
Velocity = Hitter.RootPart.CFrame.LookVector * Speed

5 Likes

Thank you, I’m not the best with CFrame, it confuses me since I only started using it over vectors a while ago and never fully grasped it. I wasn’t sure how to apply a lookvector to the new velocity and since I wasn’t really sure how it worked in the first place and tbh I was completely lost. I appreciate it!