Hello.
I am working on tweening a sliding door when you press it. It all works and all, but it doesn’t allow me to have the model at any other orientation. Here is my code for that:
door.ClickDetector.MouseClick:Connect(function()
utilityModule:tweenModel(
door,
door:GetPivot() * CFrame.new(door:GetPivot().RightVector * (door.IsOpen.Value and 5 or -5)),
TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
(door.IsOpen.Value and Enum.EasingDirection.In or Enum.EasingDirection.Out)
)
)
door.IsOpen.Value = not door.IsOpen.Value
end)
How could I make this work no matter the orientation of the door?
Thanks,
– Ham