Knockback is VERY laggy

So basically, as said from the title, I’m making knockback. But for some reason, it is SO choppy, I tried putting the body velocity on client side but it didnt make any difference.

Video:
https://gyazo.com/187dd5cb094b0a07eccbbdd70a30a20c

Code:

											spawn(function()
												if Velocity then
													local hitvel = Instance.new("BodyVelocity",hitc.HumanoidRootPart)
													hitvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
													hitvel.Velocity = Velocity
													spawn(function()
														wait(HitTime)
														hitvel:Destroy()
													end)
													hitc.HumanoidRootPart.Touched:Connect(function(touch)
														if touch:IsDescendantOf(hitc) or touch:IsDescendantOf(c) or touch:IsDescendantOf(workspace.ServerEffects) then return end
														if touch.Name ~= "Base"  or touch.Name ~= "Hitbox" then
															hitvel:Destroy()
														end
													end)
												end
											end)
1 Like

Try setting the dummys networkowner to nil

1 Like

how do i do that? Im a little new to remotes and network ownership, stuff like that
EDIT: figured it out.

1 Like

Maybe try

dummy.PrimaryPart:SetNetworkOwner(nil)

Also be sure your primarypart is the HumanoidRootPart

hmm still doesnt work.
https://gyazo.com/70e2da5e0ec9e9a6e703d410b56c2b27

Ok remove the networkowner, studio have problem with this, try testing your combat system ingame not in the studio play test

													local hitvel = Instance.new("BodyVelocity",hitc.HumanoidRootPart)
													hitvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
													hitvel.Velocity = Velocity
													spawn(function()
														wait(HitTime)
														hitvel:Destroy()
													end)
													hitc.HumanoidRootPart.Touched:Connect(function(touch)
														if touch:IsDescendantOf(hitc) or touch:IsDescendantOf(c) or touch:IsDescendantOf(workspace.ServerEffects) then return end
														if touch.Name ~= "Base"  or touch.Name ~= "Hitbox" then
															hitvel:Destroy()
														end
													end)
													hitc.PrimaryPart:SetNetworkOwner(nil)

FYI, i tried putting it on top of the instance too

Check this out

Charrrrrs

Maybe try setting the NetworkOwnerShip to the client thats hitting it