How to make a Sliding Door Model?

Hi, I am currently trying to make a door that opens when you click a button and then closes when you press the same button.

The Door:

I already know how to do it with one button but I am trying to have a cool Tween or something so that the door slides down into the floor. I honestly have no Idea how to do this. I have tried following a few tutorials but those didn’t work. Any help is appreciated, Thanks! :slight_smile:

local doorDistanceToSlide = 5 -- moves 5 studs to the right

local door = workspace.Door -- easiest if the door is a union or meshpart, since tweening models is tough

doorClickDetector.MouseClick:Connect(function()
     local endCFrame = door.CFrame CFrame.new(doorDistanceToSlide, 0, 0)
     game:GetService("TweenService"):Create(door, TweenInfo.new(1), {CFrame = endCFrame}):Play()
end)
3 Likes

This post should help you out. It’s got everything you need to know about tweening models.

1 Like