LinearVelocity isn't lags when disables

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)

VIDEOS

CREATOR


SERVER

Any help appreciated!

1 Like

Im still kind of confused after reading your post, is the player not going in the direction you intended?

You can see how victim teleports on client video at last seconds. Thats what im having trouble with.

It’s because of the SetNetworkOwner

Ohh, I see what you mean no it looks like a networkownership problem

If i will delete them, the result will be same.

Yeah but I saw videos with same thing but it was smooth. I have been trying to get same effect for almost a year.

Maybe try setting the owner to nil?

I will try when I will be able to get to PC, thanks for idea.

1 Like

Yeah no your welcome man, hope it helps

1 Like

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).

2 Likes

I tried that, sadly the result was same.

Yeah the result is better. But I still think there a better way.

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

The thing is that I want it to be smooth. The way you told me to do doesn’t have the best result.

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.

3 Likes

Thanks, it’s much better now.

random 30 letters

1 Like