Help with creating a very smooth knockback

if EnemyHRP then
	local Force = 250
	local UpwardForce = 100
	local KnockbackForce = (HRP.CFrame.LookVector * Force) + Vector3.new(0, UpwardForce, 0)
					
	EnemyHRP:ApplyImpulse(KnockbackForce)
end
1 Like

This is just a headache I think you’re better of using BodyVelocity instead if the cause is the “ApplyImpulse”, however, the problem may also be that, because the dummies you spawn on Roblox Studio depending on how you did it, they may have the primary part as their heads instead of humanoid root parts, and players have they primary part as their humanoid rootpart. Also, was it working in the start? Maybe it worked because the client part was getting it directly and not by the model primary part

The clip probably uses body velocity or body position (most likely velocity). Honestly, don’t use :ApplyImpulse, as I’ve had not great results when using it for knockback. Using a BodyVelocity and tweaking it is the way to go, especially the style of knockback you’re going for.

1 Like

The videos he have shown me proves that it probably is something to do with how he got the root part, or ApplyImpulse is just that broken… And now that I am thinking, it would’ve been way faster if I asked for the whole code, kinda sad of myself I didn’t did it but here we go

I think the suggestions to not set the network owner are sort of right but sort of wrong. I have a similar issue, but I made vast improvements from basically what you’re doing by instead having knockback handled on the victim’s client. So, in a localscript put knockback on yourself, and fire from the server to perform the knockback.

There are two issues I am trying to resolve, however. One is that there is a noticeable delay before knockback occurs due to ping, so maybe doing it on both clients or something to that effect would work. The other issue is of course that it’s possible to exploit and give yourself no knockback.

Edit: I needed to use LinearVelocity (just the updated version of bodyvelocity which I believe is deprecated), as applyimpulse just simply doesnt work, since the character controller instantly overwrites it.

1 Like