Hey there! I’m trying to tween a model position by changing it’s primary part position or CFrame and welding the parts (neither worked), but when the tween is played, only the primariy part position tweens, here’s the script:
local TS = game:GetService("TweenService")
local openPos = CFrame.new(0.85, 4.45, -8.263)
local closePos = CFrame.new(-3.35, 4.45, -8.263)
local debounce = false
local open = false
local PrimaryPart = script.Parent.Parent.Parent.Window
script.Parent.MouseClick:Connect(function()
if not debounce then
debounce = true
if not open then
local goal = {}
goal.CFrame = openPos
local tween = TS:Create(PrimaryPart, TweenInfo.new(1), goal)
tween:Play()
wait(1)
open = true
elseif open then
local goal = {}
goal.CFrame = closePos
local tween = TS:Create(PrimaryPart, TweenInfo.new(1), goal)
tween:Play()
wait(1)
open = false
end
wait(1)
debounce = false
end
end)
How can i fix this? Thanks (: