How can I add knockback to this?

I’m making a spinjitzu script (lol) and I’m trying to add knockback to it. My goal is for them to basically get shot away from the player.
My current script to do this is as follows:

--knockback
			if not hit.Parent.Torso:FindFirstChild("spinjitzuVelocity") then
				local velocity = Instance.new("BodyVelocity")
				velocity.Name = "spinjitzuVelocity"
				velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
				velocity.Velocity = (-hit.Parent.HumanoidRootPart.CFrame.LookVector * 50) + Vector3.new(0, 5, 0)
				velocity.Parent = hit.Parent.Torso
				wait(1)
				velocity:Destroy()
			end

This occurs when you touch the player’s arm when they’re using spinjitzu.

This works, but not well - they get sent… “flying” (they go up and backwards a decent distance, but very slowly) but it also seems to not take effect until I have moved away from them (for example, if I stand there with spinjitzu, my arm constantly hitting them, nothing happens, but when I finally move away and no longer am hitting them the knockback actually triggers).
How can I fix this? Or is there a better way of achieving this I should use?

EDIT: The script above is an updated script I made after changing it around a little. It’s more consistent, and does what I want, but the problems listed above (the knockback being slow and it not working until I’ve moved away from them) still applies.

1 Like

Try applying it to the humanoidrootpart rather then the torso. (Not sure if this will do much though)

“they go up and backwards a decent distance, but very slowly”
Change the * 50 to something bigger so it will faster knockback

Maybe use a magnitude check to see if player is close enough to get hit (Assuming you use .Touched events)

Lastly do this check on the clients rather then the server for better responsiveness.

This changed nothing.

This sends them back quicker, but also a further distance than I’d like. It also seems to be the same ratio of distance:speed, so for the distance it’s going it still seems rather slow.

To change the distance lower the wait(1) so that it gets destroyed quicker

like pushing, correct? I’m sorry I just woke up

i mean i guess so, yeah?

character limit

im not able to go in studio currently. but im sure others will help if possible, sorry.