How to make 3 tweens run at the same time

so i wanted to make a ui hiding with a button but animation has a desync because of my tweens runs not at the same time can someone help me?

module script:

function HideBottomButtons.Hide(button: GuiButton, frame: Frame)
	
	local buttonTween = TweenService:Create(button, TweenInfo.new(0.75, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {Position = UDim2.new(0.475, 0, .9, 0)})
	local buttonTween2 = TweenService:Create(button, TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {Rotation = -90})
	local frameTween = TweenService:Create(frame, TweenInfo.new(0.75, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {Position = UDim2.new(0.5, 0, 1.5, 0)})
	
	buttonTween:Play()
	buttonTween2:Play()
	frameTween:Play()

end
2 Likes

use coroutines or task.spawn

1 Like

Tweens don’t yield so that probably isn’t it

1 Like

Maybe you should try to use Parallel Luau + BindableEvents to play each tween. I’ve played more than 3 tweens and they all play at the same time, tho.

1 Like

please stop giving incorrect advice

2 Likes

Your tweens will all start and end at the same moment.
Maybe it’s just that it’s not looking well-synced visually? Try changing the tween times and see what effect is closest to what you want to achieve.

2 Likes

In speed 0.5 and 0.75 will yield different timed tweens.
I can’t think of anything faster than you’re doing.

maybe after a pause

local RunService = game:GetService("RunService")

RunService.Stepped:Wait()
tween1:Play()
tween2:Play()
tween3:Play()
2 Likes

the task scheduler already handles tweens per frame

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.