So I got this door to open and close with TweenService but it opens weird, moving the door slightly inward.
Video:
https://gyazo.com/9a385148344d3836aeca947dc6f805b5
Code:
proximityPrompt.Enabled = false
if isOpen then
isOpen = false
TweenService:Create(
doorUnion,
TweenInfo.new(
tweenTime,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.Out
),
{CFrame = CFrame.new(closedPosition) * CFrame.Angles(0, math.rad(closedRotation), 0)}
):Play()
wait(tweenTime)
proximityPrompt.Enabled = true
else
isOpen = true
TweenService:Create(
doorUnion,
TweenInfo.new(
tweenTime,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.Out
),
{CFrame = CFrame.new(openPosition) * CFrame.Angles(0, math.rad(openRotation), 0)}
):Play()
wait(tweenTime)
proximityPrompt.Enabled = true
end
Is there any way I can make this open and close normally?