Turret CFrame Lerping

Hello there. I’ve got an lerping issue today.

I’m trying to make a turret that is mouse controlled.

This is how the hierarchy looks like:
acade07921933eee466153f9d276283b

This is how the turret looks
5f566a6ecd254437aecde75814439014

The problem I’m facing is that when I sit in the seat, half of the model flies away.
Video -

What I want it to do is to simply behave like a normal turret.

Here is my code that’s located in the ClientScript [Localscript] in the PlayerGui:

local TurretsFolder = script.TurretsFolder
local EventsFolder = script.EventsFolder



local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local RS = game:GetService("RunService")
local Track


track = RS.RenderStepped:connect(function()
	for i,v in pairs(TurretsFolder.Value:GetChildren()) do
		if Mouse.Hit.p.Y < 0 then
			local Position = CFrame.new(v.Body.TurretBase.CFrame.p, Vector3.new(Mouse.hit.p.X,1,Mouse.hit.p.Z))
			local BasePosition = CFrame.new(v.Base.PrimaryPart.CFrame.p,Vector3.new(Mouse.hit.p.X,v.Base.PrimaryPart.CFrame.Y,Mouse.hit.p.Z))
			local LerpPosition = v.Body.TurretBase.CFrame:Lerp(Position,0.15)
			local BaseLerpPosition = v.Base.PrimaryPart.CFrame:Lerp(BasePosition,0.15)
			v.Base:SetPrimaryPartCFrame(BaseLerpPosition)
			v.Base.Connection.Weld.C1 = LerpPosition 
		end
 		if Mouse.hit.p.Y > 0 then
			local pos = CFrame.new(v.Body.TurretBase.CFrame.p,Vector3.new(1,Mouse.hit.p.Y,Mouse.hit.p.Z))
			local basepos = CFrame.new(v.Base.PrimaryPart.CFrame.p,Vector3.new(Mouse.hit.p.X,v.Base.PrimaryPart.CFrame.Y,Mouse.hit.p.Z))
			local lerppos = v.Body.TurretBase.CFrame:lerp(pos,0.15)
			local baselerppos = v.Base.PrimaryPart.CFrame:lerp(basepos,0.15)
			v.Base:SetPrimaryPartCFrame(baselerppos)
			v.Base.Connection.Weld.C1 = lerppos 
		end		
	end
end)

My ServerScript [Script] that’s located in the model:

for i,v in pairs(script.Parent.Parent.Turrets:GetDescendants()) do
	if v:IsA('BasePart') then
		local Turret = v.Parent.Parent
		
		if v.Parent.Name == 'Base' then
			if v.Name == 'Connection' then
				
				local CC = Instance.new('Weld')
				CC.Part0 = Turret.Body.MainBase
				CC.Part1 = v
				CC.C0 = Turret.Body.MainBase.CFrame:Inverse() * v.CFrame
				CC.Parent = v
			else
				
				local CC = Instance.new('Weld')
				CC.Part0 = v
				CC.Part1 = Turret.Base.Connection
				CC.C0 = v.CFrame:Inverse() * Turret.Base.Connection.CFrame
				CC.Parent = v				
			end
		elseif v.Parent.Name == 'Body' then
			if v.Name == 'MainBase' then
				
				local CC = Instance.new('Weld')
				CC.Part0 = v
				CC.Part1 = Turret.Body.TurretBase
				CC.C0 = v.CFrame:Inverse() * Turret.Body.TurretBase.CFrame
				CC.Parent = v		
			elseif v.Name ~= 'TurretBase' then
				
				local CC = Instance.new('Weld')
				CC.Part0 = Turret.Body.TurretBase
				CC.Part1 = v
				CC.C0 = Turret.Body.TurretBase.CFrame:Inverse() * v.CFrame
				CC.Parent = v		
			end
		elseif v.Parent.Name == 'ConnectingBody' then
			
			local CC = Instance.new('Weld')
			CC.Part0 = Turret.Body.TurretBase
			CC.Part1 = v
			CC.C0 = Turret.Body.TurretBase.CFrame:Inverse() *  v.CFrame
			CC.Parent = v				
			
		end
	end
end


for i,v in pairs(script.Parent.Parent.Turrets:GetDescendants()) do
	if v:IsA('BasePart') then
		v.Anchored = false
	end
end

local function Sit(SeatWeld)
	if SeatWeld:IsA('Weld') then
		
		local Character = SeatWeld.Part1.Parent
		local Player = game.Players:GetPlayerFromCharacter(Character)
		
		local CCS = script.ClientScript:Clone()
		CCS.Parent = Player.PlayerGui
		CCS.Disabled = false
	end
end

script.Parent.Parent.Seat.ChildAdded:Connect(Sit)

I can provide more information if you need it.

Thanks in advance!!

Does the model split when the lerping script is not running?
That is, can you sit in it.

@RamJoT No, it does not. It’s only while the ClientScript is running. I have a ServerScript that welds the parts using Welds.

ik this question is silly and irrelevent but does it have Motor6D attacted somewhere? I have heard that theres a glitch which offsets parts with Motor6D

@zeusplayz2005 No, there are no Motor6D’s in the model. Only welds.