Knockback Is not working! PLease help

Streamable → this is the problem
This is in a server script btw, not sure if that matters but maybe client is better? idk what u guys know?

					local OppKnockback =  Instance.new("BodyVelocity")
					OppKnockback.MaxForce =  Vector3.new(math.huge,math.huge,math.huge)
					OppKnockback.Parent =  HitHRPT
					OppKnockback.Velocity = char:FindFirstChild("HumanoidRootPart").CFrame.LookVector * 60 +Vector3.new(0,50,0)
					OppKnockback.Name = "Knockback"
					OppKnockback.P = math.huge
					game.Debris:AddItem(OppKnockback,.3)
1 Like

This usually happens when there’s another BodyVelocity with the same/higher MaxForce. It’s a flaw that has existed in BodyVelocities since their release and was never fixed. Make sure the knockback you’re applying here has a higher MaxForce than the ones from the normal punches.

Body Velocities have been deprecated for a while, try using Vector Force or Linear Velocity instead.
VectorForce | Documentation - Roblox Creator Hub

1 Like

Does linear velocity have this as well?

So ill make the normal punch knockback maxforce vector3.new(5000,5000,5000) and keep this as math;uge?

VectorForces have a Force property (not MaxForce)

Sorry thought you were talking about VectorForces :sweat_smile:

Bruh, so then what the hell do i do :sob:

i mean since body velocities have been deprecated like Wigglyaa had mentioned, you should probably try using Vector Force or Linear Velocity. I mean, I’ve used them and they work just fine if not better than the old body velocities.

if you HAVE TO use the old BodyVelocity, you should try applying the force for the super punch with a higher MaxForce than the other BodyVelocity I believe

Yeah it’s even worse with LinearVelocities. If you have more than 1 that push the same part your character will turn into a plane and fly around.

Yes exactly. 5000 might not be enough to push characters (especially ones with many accessories) but try to scale MaxForce based on how much force the knockback gives.

My issue is that it SOMETIMES doens’t work, but it seems like it doesnt work in very selective areas. For exmple, in the clip above, the dummy i hit who took lagged knockback ( the problem ) feels like that dummy in htat spot alyways has this knockback problem when im testing.

i use math.huge for my knockback or 8,000. i tried making it 5k for normal hits and math.huge for big hits and its still the same. 95% of hits are working but randomly sometimes their is no knockback.

Should i js use tween service or a bezier curve to move the character instead?Cause i just want an upward motion.

My recommendation is to delete any old BodyVelocity when creating a new one, this way you don’t risk any of them overwrites each other.

-- find and delete old knockbacks
for _, child in ipairs(HRPT:GetChildren()) do
   if child:IsA("BodyVelocity") then
      child:Destroy();
   end;
end;

local OppKnockback =  Instance.new("BodyVelocity")
OppKnockback.MaxForce =  Vector3.new(1e20, 1e20, 1e20)
OppKnockback.Parent =  HitHRPT
OppKnockback.Velocity = HitHRPT.CFrame.LookVector * 60 +Vector3.new(0,50,0)
OppKnockback.Name = "Knockback"
--OppKnockback.P = math.huge **
game.Debris:AddItem(OppKnockback,.3)

** I don’t recommend changing the P property but if you really need to then remove the comment I made.

Try this and see if it works now.

What does 1e20 mean? and thanks illl try it, but ngl nothing seems to work

It means 1 with 20 zeroes, so 100000000000000000000. Little exagerated but good to make sure there are no limits to how much knockback you want it to give.

Ight so my fried suggested i swithed to vector fores cause bv depricated and ithouhgt it was alg but then i experienced the same bug whilet esting a bit l8r, didnt get in on video this time but then i went back, kept vvector fores and added a check to make sureno vector fores remain and now i js have to find someone to test w/ but ill lyk if theirs a problem again

1 Like

Sadly It didnt work :frowning: not even close exact same problem and i even added checks to make sure hrpt isnt anchored and that all other vector forces r deletd