Hey, I want to make a door where it animates the movement in a short amount of time by moving 95 degrees on first click(Open) and -95 and second click(Close)
My code:
local ts = game:GetService("TweenService")
local t1 = ts:Create(script.Parent, TweenInfo.new(2.5, Enum.EasingStyle.InOut), {CFrame = script.Parent.CFrame * CFrame.Angles(0, 95, 0)})
local t2 = ts:Create(script.Parent, TweenInfo.new(2.5, Enum.EasingStyle.InOut), {CFrame = script.Parent.CFrame * CFrame.Angles(0, -95, 0)})
local Door = script.Parent
local Detector = script.Parent.ClickDetector
local Open = false
function Clicked1()
t1:Play()
Open = true
end
Detector.MouseClick:Connect(Clicked1)
function Clicked2()
t2:Play()
Open = false
end
Detector.MouseClick:Connect(Clicked2)
