How'd y'all use BodyForce?

Hello, I’m trying to make a knockback system for my hammer. I’m VERY new to BodyForces so I don’t know how to use it but this is my attempt…

				local knockback = Instance.new("BodyForce")
				knockback.Parent = hitRootPart
				knockback.Force = rootPart.CFrame.LookVector * force
				wait()
				knockback:Destroy()

Unfortunately, it doesn’t do any knockback. There’s nothing on the output.

1 Like

You end up only applying the force for about 1/30th of a second, so the thing doesn’t end up accelerating very much.

You might want to apply an impulse instead, which can instantaneously move an object. You can do that like so:

hitRootPart:ApplyImpulse( rootPart.CFrame.LookVector * force )

although you’d want to rename the `force´ variable in that case.

are you really? i tried that and it didnt worked

changed the wait() to wait(.1). still no knockback is being applied. ;-;

1 Like