So I have tried to use a LinearVelocity. It’s all good but on creator screen the moment when LinearVelocity disables, the victim teleports to end position. Is there a way to fix this?
CODE
local plr = game.Players:GetPlayerFromCharacter(target) --Will return nil if no player
local hrp: BasePart = target.HumanoidRootPart
local hum: Humanoid = target.Humanoid
hrp:SetNetworkOwner(owner)
hum.AutoRotate = false
--[[local a = Instance.new("Attachment")
a.Parent = hrp
a.Name = "LinearVelocityAttach"]]
local vel = Instance.new("LinearVelocity")
vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
vel.Attachment0 = hrp.RootAttachment
vel.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
vel.MaxForce = 11000
vel.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
vel.VectorVelocity = force
vel.Parent = hrp.RootAttachment
delay(debris,function()
vel:Destroy()
hum.AutoRotate = true
hrp:SetNetworkOwner(plr)
end)
Also I recommend using the velocity of the RootPart Instead of using Linear Velocity as that defies gravity, IE: You KB on a high place which would then make the character float till the Knockback ends, which is what most of the games with KB uses as you don’t need to set the NetworkOwner which causes some odd snappings due to lag(Network Latency).
what are you trying to do exactly lol, unless its an Air Combo Knock down to the ground I don’t know why you wanna use LinearVelocity/Others for simply giving a push to the enemy
It will never be smooth because you’re dealing with Lag(Network Latency) here, thought the Built-In AssemblyLinearVelocity should be smooth enough to not have the snapping effects(At least for me it doesn’t happen), unless you’re setting the NetworkOwner I don’t see why that’s not smooth. Especially if you do it on an NPC it will be much smoother because its ran by the server.
PS: Not really sure what do you mean by ‘smooth’ but, here’s me using AssemblyLinearVelocity for KB, for me that can’t get any smoother.