Line Force moves character slightly to the side

Line Force located inside of the Character’s Primary Part (Humanoid Root Part) works as it supposed to but after first use somewhy start to tweak and move the character slightly to the side.
(if u set magnitude like to 500 you can see that character is actually rotation around itself)

I do not know why is it happening

Demonstration of what i mean:

The script:

local RP = game:GetService("ReplicatedStorage")

local function LoadGear(Character,GivenParent)
	local localODMGear = RP.ODM.Gear:Clone()
	localODMGear.Parent = GivenParent
	localODMGear.Name = Character.Name
	localODMGear.Model.LeftHook.Weld.Part1 = Character.PrimaryPart
	localODMGear.Model.RightHook.Weld.Part1 = Character.PrimaryPart
	return localODMGear

local function GetMass(Model)
	local mass = 0
	for i, v in pairs(Model:GetChildren()) do
		if v:IsA('BasePart') or v:IsA('Union') then
			mass = mass + v:GetMass()
	return mass

_G.HookMaxDistance = 75

		Character.PrimaryPart = Character:WaitForChild("HumanoidRootPart")
		local localODMGear = LoadGear(Character,workspace.GlobalPlayersGear)
		local LeftHookBeam = localODMGear.Model.LeftHook.Beam
		local LeftHookHitbox = localODMGear.Model.LLHP
		local LeftHookOn ="Attachment",LeftHookHitbox)
		LeftHookOn.Name = "LeftHookOn"
		local RightHookBeam = localODMGear.Model.RightHook.Beam
		local RightHookHitbox = localODMGear.Model.LRHP
		local RightHookOn ="Attachment",RightHookHitbox)
		RightHookOn.Name = "RightHookOn"
		local PlayerMass = GetMass(Character)

        --Ignore everything up here ^^^, all important stuff is down below
		local VA ="Attachment", Character.PrimaryPart)
		VA.Name = "VectorAttachment"
		VA.WorldPosition = Character.PrimaryPart.AssemblyCenterOfMass
		local LHF ="LineForce", Character.PrimaryPart)
		LHF.Name = "LeftHookForce"
		LHF.Enabled = false
		LHF.ApplyAtCenterOfMass = false
		LHF.Attachment0 = VA
		LHF.Magnitude = PlayerMass * 50
		local RHF ="LineForce", Character.PrimaryPart)
		RHF.Name = "RightHookForce"
		RHF.Enabled = false
		RHF.Attachment0 = VA
		RHF.Magnitude = PlayerMass * 50

RP.ODM.LeftHook.OnServerEvent:Connect(function(Player, Status, MousePos, Distance)
	if Distance > _G.HookMaxDistance then
		Player:Kick("Detected suspicious movement")
	local localODMGear = workspace.GlobalPlayersGear:FindFirstChild(Player.Name)
	local LHF = Player.Character.PrimaryPart:FindFirstChild("LeftHookForce")
	local LeftHookHitbox = localODMGear.Model.LLHP
	local LeftHookOn = LeftHookHitbox:FindFirstChild("LeftHookOn")
	if Status then
		LHF.Enabled = true
		LHF.Attachment1 = LeftHookOn
		LHF.Enabled = false


From what i tried to do to fix this is - Setting attach0 and attach1 to nil, disabling the line force, destroying line force with :destroy() and debris.

Appreciate any help :pray:

That looks more like the model itself. Try setting all of the parts in the model to Massless.

This would have no sense since the odm gear model isnt even attached to the Character, the only thing is a weld between model and HumanoidRootPart. Odm gear is not collidable, cant be touched and from now is Massless.

Still not fixed though

Guys, I’m just dumbass and forgot to fire remote event and because of that disabling of Line Force actually never happened, i found it out by just switching to server side view in roblox studio and messing up with hooks.

1 Like

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