Sliding door script help

Hello.

I would like to make a sliding door but i don’t know how i can do it ? What do i have to use ? “Vector” or “Position” or something else ?? And where i can find good informations about how to do it ?
Capture

this will probably help you

1 Like

I tried something but it doesn’t work… Can you tell me what is missing to the script or to the parts ??

I think this post below is all you need.

2 Likes

Ensure that you anchor both parts, as otherwise the door will fall apart when it’s created.

Also, I suggest you read CFrames as simply changing the Positions of parts can cause issues such as parts being unable to pass through one another. Also, the third argument in tweenService:Create() takes a dictionary of properties you wish to change, and what to change it to.

goalData = {CFrame = goal.CFrame}
local tween = tweenService:Create(part,TweenInfo.new(5),goalData)
tween:Play()

Also, you shouldn’t be creating a new instance of Door as that’s already a part of the game

1 Like

You can use TweenService to make the door slide, for example:

local tweenTable = {
table2.Position = Vector3.new(X,Y,Z)
}

game:GetService("TweenService"):Create(Instance,TweenInfo.new(number of seconds),tweenTable):Play()

Yes this is my first reply.

2 Likes

Thank you so much !!! I’m very confused with all differents services that people use. Oh and happy birthday !