I don’t think they “freeze” midair, all that’s happening is the BodyPosition is reaching the goal, but it’s not getting deleted the moment it’s reaching the goal, so it suspends there until it’s deleted.
So what you wanna do instead is use ApplyImpulse with a vector pointing to the goal.
ApplyImpulse takes in a Vector3 and adds it as force to the targeted part.
From my reading ApplyImpulse will only work if the side its fired from has network ownership over the target. So if a server tries to apply a velocity to the player, it wont work unless the server has network ownership over character’s primary part.
SetNetworkOwner(nil)
This sets the network ownership of a part to the server, to set it to a player you would replace nil with a Player object. Heres a hyperlink to learn more about Network Ownership
An alternative to this would be to use remote events to apply knockback to the target on their client.
function damagemod.Knockback(hum,AttackCFrame,intensity)
if not hum.Parent.HumanoidRootPart:FindFirstChildOfClass("BodyPosition") then
print("ee")
local attFrame = CFrame.new(AttackCFrame.Position,hum.Parent.PrimaryPart.CFrame.Position)
local cframe = CFrame.new(attFrame.Position + Vector3.new(0,intensity[1],0)) + attFrame.LookVector * intensity[2] --hum.Parent.PrimaryPart.CFrame
local bodypos = Instance.new("BodyVelocity",hum.Parent.PrimaryPart)
local human = hum.Parent:FindFirstChildOfClass("Humanoid")
bodypos.Velocity = cframe.Position
bodypos.MaxForce = Vector3.new(99999,99999,99999)
bodypos.P = 9999
bodypos.ReachedTarget:Connect(function()
bodypos:Destroy()
end)
end
end
Why not just listen for the “ReachedTarget” event to fire on the BodyPosition instance before destroying it? Instead of creating an additional thread of execution (with the spawn() global) and waiting for an arbitrary length of time (0.1 seconds). The ReachedTarget event of a BodyPosition instance will fire whenever the BodyPosition reaches its specified destination described by the “Position” property of the instance itself.
If “ReachedTarget” isn’t firing then the BodyPosition instance isn’t reaching its target. Unless you’re trying to claim that information for the official documentation is inaccurate.
This is the property I’m referring to which represents the goal of the BodyPosition.
Taking another glance at your script I’ve noticed you aren’t setting the “.Position” property of the BodyPosition, this property describes the end-goal of the BodyPosition instance.
local BP = Instance.new("BodyPosition")
BP.Position = Vector3.new(0, 0, 0) --example