--Velocity is a variable predetermined in earlier parts of this script.
--Velocity is a vector3
if Target.Character.Torso:FindFirstChild("BV") == nil then
BV = Instance.new("BodyVelocity")
BV.Name = "BV"
BV.Parent = Target.Character.Torso
end
Target.leaderstats.LastHit.Value = Player.Name
Target.Character.Torso.BV.MaxForce = Vector3.new(10000,1000000,0)
Target.Character.Torso.BV.Velocity = Velocity
wait(0.0001)
Target.Character.Torso.BV:Destroy()
So, above is a part of my code that makes knockback. I initially just wanted to change the velocity property. It works fine on dummys, but not on players' characters.
I am now forced to use body velocities for characters but there is one problem.
The purpose of each is completely different.
Velocity property adds a burst of force, and lets the physics engine naturally slow the object down.
Body velocity is meant to apply constant velocity.
I tried to replicate that burst of energy by destroying the body velocity in a really short time frame.
The problem with this is the lag. Sometimes, if the velocity is changed quick enough, it works, but it is a little rough. Most of the time, nothing happens because the body velocity is destroyed
When i change the wait time to 0.1, the big knockback looks good, but short knockback is increased due to the amount of time the body velocity has to push.
How can I do a short burst kinda like altering the velocity property with a body velocity?

2 comments
You could gradually decrease the force, then destroy it.
Since the server does not calculate the players physics you might want to test this by setting it on the client side.