Is their a way to tween multiple things in 1 Tween?

Hello! I’m trying to make a tween but I’m also trying to make a tween that single handedly Tweens 2 UI

Is that Possible? And how can I do it?

Iirc, If you’re trying to tween the same properties, then yea, you could loop over the parent GuiObject, assuming that both UI’s are under it, and tween them passing in the value for the for loop as the tween instance. However, if you’re trying to tween different properties, then no you would need seperate tweens.

1 Like

Im trying to Tween 2 UI Text Labels in One Tween, said nothing about properties.

1 Like

If you are using TweenService, you have to create a new tween for every instance. However, if one of your textlabels is the child of your other textlabel, then you only need to create one tween for the parent.

Could you not create a frame and parent both text Labels to that frame? You can either do this or the method that @magicalmariomario rightfully said, but it might get a bit confusing if one text Label is the parent of another.

I find a simple ‘for loop’ does the trick.

for _, UI in pairs( {Object1, Object2} ) do
- -Create tween here
- -Play tween here
end

works great for me, though its technically two tweens in one line.

4 Likes

Kon’nichiwa! :bowing_woman:t2:

local TweenService = game:GetService("TweenService")
local Time = 1
local TweenInfo = TweenInfo.new(Time, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
--You can build the tweens anywhere earlier in the script.
local Tween1 = TweenService:Create(nv, TweenInfo, {Value = 2})
local Tween2 = TweenService:Create(nv, TweenInfo, {Value = 3})

--Then you can call them at the same time in a function later in the script.
local function PlayTweens(PT)
  for i,k in pairs(PT) do
    k:Play()
  end
end

PlayTweens({Tween1,Tween2})

Hope this helps, let me know if you have questions.

@ShiningLuck hinted at this in his reply as well.

4 Likes