Linear velocity freezing character

Hello, recently i’ve been trying to do a knockback system for my weapons. The thing is that, when i try to use LinearVelocity for the knockback system, it freezes my character for exactly 10 seconds

Also, it’s weird that it freezes for 10 seconds, as the LinearVelocity instance is deleted 5 seconds after it’s created

This code is connected to a RemoteEvent that is fired from the server with all the info it needs…

Direction is ok, maxforce is ok, but i dont know what’s wrong. As the player has meshes welded to the character (the M4A1 weapon model), i also tried to set all meshes to massless but it keeps happening… Any ideas? Please help!

	local force = 80000

	local att = Instance.new("Attachment")
	att.Parent = char.HumanoidRootPart
					
	local kbVelocityIns = Instance.new("LinearVelocity")
	kbVelocityIns.Attachment0 = att
	kbVelocityIns.Parent = char.HumanoidRootPart
	kbVelocityIns.MaxForce = force
	kbVelocityIns.VectorVelocity = originalDirection * 10

	Debris:AddItem(kbVelocityIns, 5)
	Debris:AddItem(att, 5)

Solved! The problem wasn’t on LinearVelocity, it was happening with an invisible object that was welded to the character and was anchored

If you are going to weld something to a character, make sure it isn’t anchored!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.