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)
Very simply, the first parameter you put inside of TweenInfo.new()
which is in your case `1``, is the value that indicates how long it would take the tween to finish its tweening.
TweenInfo.new(5, Enum.EasingStyle.Quad) --for example, I made it do the tween for 5 seconds