Help making a sliding door

Hello!

Do anybody have any idea how I could script/make a door that slides outwards then slides to the right/left? I’m basically trying to add a working door to a coach (bus) but have no idea how to approach making that actually work.

Example of what I mean using studios move tool

Appreciate any suggestions.

1 Like

You can use tween service I guess

2 Likes

As @kittyPGR said, you can use TweenService and maybe you could even add a ProximityPrompt to give the mobile users a button to open the door.

1 Like

or a part can be used and part.Touched can be used

I’ll give this a go. Mobile users have a GUI that popup for them to control the doors when they are driving but thanks for the idea.

Because TweenService doesnt allow you to change a models CFrame. What I use to tween a model is

Create a CFrameValue

And use a .Changed event connected to the CFrameValue.
Then I simply tween the CFrameValues’s value and apply the changes to the model using Model:PivotTo(CFrame.Value)

Or you could use AlignPosition object and align them with 2 invisible nodes.
1 node for DoorOpen
1 node for DoorClosed

True, but you can use Model.PrimaryPart.CFrame in order to execute the function using TweenService
Unless the model doesn’t have a Primary Part, I would advise adding that to help with grip constraints

TweenService does allow you to change a models CFrame

local TS = game:GetService(“TweenService”)
local Part = Instance.new(“Part”)
local Tween = TS:Create(Part, TweenInfo.new(1), {CFrame = CFrame.new()})
Tween:Play()

Correct me if im wrong but thats only for parts?
Unless it works for primaryparts, then i stand corrected

Nevermind just read above. 30CHAR

I want to load the users entire avatar for my leaderboard system.

Create a new topic, ill help you if you need it

i suggest you attach two PrismaticConstraints to the door, one in the direction of slide outward stage, other for the slide sideways; first, you set them both Enabled=false; then, enable the first one and attach a servo to it; when it is done, disable this one and enable the second with a servo also readied
you might also need to set Anchored property of your door in-between the enabling/disabling lines of your script - so that the constraint doesn’t mess with the position too soon

and maybe consider using Motor6D for the whole part