So I've made a door CFrame rotation, but I can't get it to open slower. I knew that using the Enum.EasingStyle wouldn't help but I tried it anyways. I've also tried using simple wait commands, but either I'm not putting them in the right place or it doesn't work. Here is my code:
local tween = game:GetService("TweenService")
local center = script.Parent.Center
local door = "closed"
local CF = Instance.new("CFrameValue")
CF.Value = center.CFrame
CF.Changed:Connect(function()
center.CFrame = CF.Value
end)
local debounce = false
script.Parent.Door.ClickDetector.MouseClick:Connect(function()
if debounce == true then return end
debounce = true
if door == "closed" then
--Open door
tween:Create(CF, TweenInfo.new(1, Enum.EasingStyle.Quad), {Value = center.CFrame * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))}):play()
door = "open"
else
--Close door
tween:Create(CF, TweenInfo.new(1), {Value = center.CFrame * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))}):play()
door = "closed"
end
wait(1)
debounce = false
end)

1 comment
Wow, I can't believe I didn't think of that, my mind fails me sometimes lol. Thanks!