Body Velocity not working

  1. I want to achieve a knockback that knocks the victim back in the direction of the attacker’s humanoid facing.

  2. Everything works and the body velocity gets instanced but after that nothing happens. Like if the body velocity is not working

  3. I have tried putting it in the torso instead of the humanoidRootPart but nothing changed

by the way, the players are r6. Not sure if that changes anything at all but just letting you all know.

all script

remote.OnServerEvent:Connect(function(plr, player)
	player.canDamage.Value  = true	
	if player.canDamage.Value  == true then
		player.canDamage.Value = false
		local event; event = player.Character["Right Leg"].Touched:Connect(function(hit)
			local humanoid = hit.Parent:FindFirstChild("Humanoid")
			if humanoid then
				humanoid:TakeDamage(10)
				local anination = Instance.new("Animation")
				anination.AnimationId = "rbxassetid://6885472391"
				local anim = humanoid:LoadAnimation(anination)
				anim:Play()
				local knockback = Instance.new("BodyVelocity")
				knockback.MaxForce = Vector3.new(1,0,1) * 3000
				knockback.Velocity = humanoid.Parent.HumanoidRootPart.CFrame.lookVector * 100
				knockback.Parent = humanoid.Parent.HumanoidRootPart
				wait(1)
				knockback:Destroy()
				
				player.canDamage.Value = false
				event:Disconnect()
			else
				event:Disconnect()
			end
		end)
	end
end)

BodyVelocity Part of script

				local knockback = Instance.new("BodyVelocity")
				knockback.MaxForce = Vector3.new(1,0,1) * 3000
				knockback.Velocity = humanoid.Parent.HumanoidRootPart.CFrame.lookVector * 100
				knockback.Parent = humanoid.Parent.HumanoidRootPart
				wait(1)
				knockback:Destroy()
				
				player.canDamage.Value = false
				event:Disconnect()
			else
				event:Disconnect()
			end
		end)
	end
end)
1 Like

please help me out It is the second time posting this. No one seems to be able to help yet.

That’s a really low amount for the MaxForce property, are you aware that it also relies on the entire Character Model’s total mass? If you set it to a low amount like that, it’ll not work that well

				knockback.MaxForce = Vector3.new(1,0,1) * 200000

You should set it to something like this

1 Like

its still not working. I am not sure why this is very strange. let me double check. Does it change anything if the humanoidRootPart is anchored btw?

wait nvm its working now that I unanchored the humanoidRootPart

If the Anchored property is set to true, no physics would be applied on that specific BasePart (Or the HumanoidRootPart)

So basically, setting it to true = no skrt skrt

I just have one more problem. the dummy goes the wrong way. I want it to go in the direction of the attackers humanoidRootPart but its not working. How do I do it?

Nvm I just fixed that. Thanks for everything mate. I will give you a solution!