BodyForce Not Working

Im tying to make character knockback and am using bodyforceto do so. Apparently this does not work:

	local KB = Instance.new("BodyForce")
	KB.Parent = root
	KB.Force = (hitter.CFrame.LookVector + hitter.CFrame.UpVector)/2 * Knockback

I dont see the problem. Yes the character is unanchored

I don’t see the problem either. In what way is it not working? Can you supply a video or explain what it should be doing and what it does when the code is running?

What it should be doing : Knocking back the target with a custom knockback value.
What it is doing : RobloxStudioBeta 2020-09-15 19-44-39-223
(The damage is intentional)

It could be entirely possible that you’re not applying enough force. I don’t often work with physics so I can’t speak about a better value to use, but you’re also competing with the Humanoid’s forces when you apply them to a character. Two tests you can run:

  • Increase the force that the BodyForce applies to the character. Try higher numbers, even if it causes weird behaviours, and work from those tested numbers.

  • Change the Humanoid’s state to PlatformStand either by using ChangeState or by setting the PlatformStand property to true. The PlatformStand state disables the Humanoid’s physics and allows them to be influenced by other objects.

1 Like