Sliding door doesn't open all the way

I am trying to create a sliding door, but the parts only slide up a little bit. How could I fix this?

robloxapp-20240919-1702025.wmv (1.8 MB)

local tweenservice = game:GetService("TweenService")

local model = script.Parent
local lowerdoor = model.lower
local upperdoor = model.upper
local prompt = model.upper.Attachment.ProximityPrompt

local tweeninfo = TweenInfo.new(1)

local leftgoalopen = {}
local leftgoalclose = {}
leftgoalopen.CFrame = lowerdoor.CFrame * CFrame.new(0, -lowerdoor.Size.X, 0)
leftgoalclose.CFrame = lowerdoor.CFrame
local lefttweenopen = tweenservice:Create(lowerdoor, tweeninfo, leftgoalopen)
local lefttweenclose = tweenservice:Create(lowerdoor, tweeninfo, leftgoalclose)

local rightgoalopen = {}
local rightgoalclose = {}
rightgoalopen.CFrame = upperdoor.CFrame * CFrame.new(0, upperdoor.Size.X, 0)
rightgoalclose.CFrame = upperdoor.CFrame
local righttweenopen = tweenservice:Create(upperdoor, tweeninfo, rightgoalopen)
local righttweenclose = tweenservice:Create(upperdoor, tweeninfo, rightgoalclose)


prompt.Triggered:Connect(function()
	if prompt.ActionText == "close" then
		lefttweenclose:Play()
		righttweenclose:Play()
		prompt.ActionText = "open"
	else
		lefttweenopen:Play()
		righttweenopen:Play()
		prompt.ActionText = "close"
	end
	
end)

can you do a video of the problem or show the explorer where everything is parented

Screenshot 2024-09-19 173902

1 Like

You may be using the wrong dimensions for tweening, since the rest of the script is fine. Try using Y or Z size

1 Like

yeah i think thats all thats happening

1 Like

add some debugging, and also if you could try changing the cframe to a little higher to see if it affects any results, some debugging i would do is a print before and after the tweening to compare the results, and then printing the cframe or position of what you expected

1 Like