So im having an issue with ApplyImpulse for knockback. Previously, I was using BodyVelocity which did seem to work slightly better, but also had an issue where it would kind of lag and the distance was not constant.
function MovesManager:Knockback(Attacker, Target, Power, Length, FaceDirection, OnEnd)
--if not Target.PrimaryPart:FindFirstChildWhichIsA("BodyVelocity") then
Target:FindFirstChildWhichIsA("Humanoid").AutoRotate = false
Target.PrimaryPart:ApplyImpulse(Attacker.PrimaryPart.CFrame.LookVector * 1000)
if FaceDirection and FaceDirection == true then
Target.PrimaryPart.CFrame = CFrame.new(Target.PrimaryPart.Position, Attacker.PrimaryPart.Position)
end
task.delay(Length, function()
Target:FindFirstChildWhichIsA("Humanoid").AutoRotate = true
if OnEnd then OnEnd() end
end)
--end
end
I attmpted to lower the power but all that happens is that the dummy wont move or a very small distance
I made one of the dummy’s massless, and while the knockback is a lot better, for some reason it doesn’t look as linear as BodyVelocity if you understand what i mean. Rather here’s a video
Fixed the issue, did some math with the mass and then realised my kicking animation was causing the issue for the knockback as it only got the LookVector when the animation was looking back