local TweenService = game:GetService("TweenService")
local door1 = script.Parent:WaitForChild("Door1")
local door2 = script.Parent:WaitForChild("Door2")
local tweeningInformatin = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local door1Open = {CFrame = CFrame.new(0.5, 6, 65.5)}
local door2Open = {CFrame = CFrame.new(0.5, 6, 46.5)}
local door1Close = {CFrame = CFrame.new(0.5, 6, 59.5)}
local door2Close = {CFrame = CFrame.new(0.5, 6, 52.5)}
local Tween1Open = TweenService:Create(door1,tweeningInformatin,door1Open)
local Tween2Open = TweenService:Create(door2,tweeningInformatin,door2Open)
local Tween1Close = TweenService:Create(door1,tweeningInformatin,door1Close)
local Tween2Close = TweenService:Create(door2,tweeningInformatin,door2Close)
script.Parent.Detector1.Touched:Connect(function(hit)
Tween1Open:Play()
Tween2Open:Play()
wait(2)
Tween1Close:Play()
Tween2Close:Play()
end)
script.Parent.Detector2.Touched:Connect(function(hit)
Tween1Open:Play()
Tween2Open:Play()
wait(2)
Tween1Close:Play()
Tween2Close:Play()
end)
``
COMMUNITY QUESTION
Why do the doors for this sliding door mechanic turn when it opens?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.
