I made a drawer and it got handles but when i tween the drawer they are not coming together.
Handles doesn’t move.
I tried to unanchor and anchor all the parts but nothing worked
local TweenService = game:GetService("TweenService")
local prompt = script.Parent.Drawer.Prompt.Open
local EndPos = script.Parent.DrawerEnd
local StartPos = script.Parent.Drawer
local Drawer = script.Parent.Drawer
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local OpenTween = TweenService:Create(Drawer, tweenInfo, {Position = EndPos.Position})
local CloseTween = TweenService:Create(Drawer, tweenInfo, {Position = StartPos.Position})
local Open = false
prompt.Triggered:Connect(function()
if Open == false then
OpenTween:Play()
Open = true
else
CloseTween:Play()
Open = false
end
end)
Tweening is movement through code, instead, for welds, you want movement through physics. So you must use something like body movers or velocities for the weld to move along.
Another solution is to make all the parts that are welded a model and tween the model instead. For model tweening, you should check this code sample.