Knockback makes dead NPCs fly really far

So i have this combat system for my game that involves melee knockback, everything works perfectly until i kill the enemy and blud gets launched back like an anime character. Whats the best way to fix this?

heres the code to the melee weapon

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RaycastHitbox = require(ReplicatedStorage.RaycastHitboxV4)
local collectionService= game:GetService("CollectionService")

local newHitbox = RaycastHitbox.new(script.Parent)

newHitbox.Visualizer = false


script.Parent.Attack.OnServerEvent:Connect(function(p, lookVector)
	newHitbox:HitStart()
	newHitbox.OnHit:Connect(function(hit, humanoid)
		if humanoid.Parent:HasTag("Enemy") then
			local walkspeed = humanoid.WalkSpeed
			humanoid:TakeDamage(30)
			humanoid.WalkSpeed = 0
			humanoid.Parent.HumanoidRootPart.Velocity = lookVector*100
			script.Parent.Damage1:Play()
			wait(0.2)
			humanoid.WalkSpeed = walkspeed
		end

	end)
	wait(0.3)
	newHitbox:HitStop()
end)
1 Like

If you look at the script of a lot of the old Roblox gear that had knockback, they would put a body mover into the enemy that would have the velocity to make them knock back, then after 1 second the body mover is destroyed.

I’m sure you could look at some of those old hammer gear or others and find out how they do it, and use a modern constraint to duplicate it.

By using a body mover, you can get a consistent velocity for parts that are player controlled, or that are npc, or static (dead)