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.
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)
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()
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