Door tween is slow

I have a script which makes the door open and close making it look like that a intruder want to go in there. However it’s slowly and I want it to be fast. How do I do it?

local TweenService = game:GetService("TweenService")

local hinge = script.Parent.Hinge

local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(1), 0)

local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)

local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)

while true do
	tweenClose:Play()
	task.wait(0.2)
	tweenOpen:Play()
	task.wait(0.2)
end

The duration of the tween is set by the number in here:

TweenInfo.new(1)

Currently it’s set to 1 second, try setting it to somehting lower such as 0.2 seconds.

1 Like