So I'm making an animation system via tween for a bus and I wanna perform 2 tweens, an initial tween moving the doors away from the body and a second tween moving them to the side. I can't just tween to where I want, I need to tween to a part's position, so I grabbed this script to make sure it works.
local TS = game:GetService("TweenService")
local tweeningInformation = TweenInfo.new(
--Tween Properties.
5, -- Length
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
.1
)
local partProperties = {
Size = Vector3.new(script.Parent.Parent.pos.Size);
Position = Vector3.new(script.Parent.Parent.pos.Position);
}
local Tween = TS:Create(script.Parent,tweeningInformation,partProperties)
script.Parent.ClickDetector.MouseClick:Connect(function()
Tween:Play()
end)
GIF linked is what happens when I click the part. https://gyazo.com/0cc9f60d8f2801aa10535d38938c89df
