Whenever I play my tween its orientation changes properly however it returns to the origin of the baseplate. I’m sure its simple but can someone explain why this is happening?
Thanks!
local proxPrompt = script.Parent
local Door = game.Workspace:WaitForChild("Door")
local Hinge = game.Workspace:WaitForChild("Hinge")
local tweenService = game:GetService("TweenService")
local tweenGoalOpen = {}
tweenGoalOpen.CFrame = CFrame.Angles(0,math.rad(90),0)
local tweenGoalClose = {}
tweenGoalClose.CFrame = CFrame.Angles(0,0,0)
local tweenInfo = TweenInfo.new(
.35,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.In,
0
)
local tweenOpen = tweenService:Create(Hinge, tweenInfo, tweenGoalOpen)
local tweenClose = tweenService:Create(Hinge, tweenInfo, tweenGoalClose)
local doorOpen = false
proxPrompt.Triggered:Connect(function(plr)
if doorOpen == false then
tweenOpen:Play()
doorOpen = true
else
tweenClose:Play()
doorOpen = false
end
end)