Doors primarypart moving but not the whole model

I made this sliding door model for a game Im making for fun but what is bugging me is that the whole door wont move only the primarypart

Would i have to weld it or something?

local door = script.Parent.Parent.Door
local sound = door.Sound
local status = script.Parent.Status
local ClickDetector = script.Parent.ClickDetector

local TweenService = game:GetService("TweenService")

local primaryPart = door.PrimaryPart
local OpenCFrame = primaryPart.CFrame
local CloseCFrame = OpenCFrame * CFrame.new(0, -7, 0)

local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

local DoorOpen = TweenService:Create(primaryPart, tweenInfo, {CFrame = OpenCFrame})
local DoorClose = TweenService:Create(primaryPart, tweenInfo, {CFrame = CloseCFrame})

local debounce = false

ClickDetector.MouseClick:Connect(function()
	
	if not debounce then
		
		debounce = true
		
		if status.Value == "CLOSED" then
			
			DoorOpen:Play()
			sound:Play()
			status.Value = "OPEN"
			
		elseif status.Value == "OPEN" then
			
			DoorClose:Play()
			sound:Play()
			status.Value = "CLOSED"
			
		end
		
		task.wait(tweenInfo.Time)
		debounce = false
		
	end
end)
2 Likes

should weld all the parts to the primary part and unanchor them, just anchor the primary part

Alright let me try that right now

worked like a charm, ppreciate it

1 Like

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