So, I'm trying to combat door lag in my place. One of the ways of doing that is by locally scripted the doors and using TweenService.
I have a CFrame function bellow:
local offset = hinge.CFrame:inverse() * doorModel.CFrame;
for i=1,40 do
wait()
hinge.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(1)*i*0.1, 0)
doorModel.CFrame = hinge.CFrame * offset
end
My question is, that this is using just CFrame. How can I turn this into Tween Service? My attempt is bellow, but got no results:
local offset = hinge.CFrame:inverse() * doorModel.CFrame;
hinge1.CFrame = hinge1.CFrame * CFrame.Angles(0, math.rad(1)*i*0.4, 0)
local OutTween = TweenService:Create(door.Scripted.Door, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = hinge1.CFrame * offset})
OutTween:Play()
Any ideas? Thank you! ~ DrBaja
