Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to shorten a tweening?

Play.MouseButton1Click:Connect(function()
	
	GuiSounds.Select:Play()
	game.ReplicatedFirst.Start.Disabled = true
	tweening:Play()
	
	Play:TweenPosition(UDim2.new(-1, 0, 0.264, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1, false)
	Updates:TweenPosition(UDim2.new(-1, 0, 0.382, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 2, false)
	Credits:TweenPosition(UDim2.new(-1, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 3, false)
	Donate:TweenPosition(UDim2.new(-1, 0, 0.618, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 4, false)
	
	Back.Visible = true
	Back:TweenPosition(UDim2.new(0, 0, 0.833, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1.2, false)
	
	Hair.Visible = true
	Beard.Visible = true
	Skin.Visible = true
	Gender.Visible = true
	Race.Visible = true
	
	Hair:TweenPosition(UDim2.new(0, 0, 0.29, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1.2, false)
	Beard:TweenPosition(UDim2.new(0, 0, 0.396, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1.2, false)
	Skin:TweenPosition(UDim2.new(0, 0, 0.501, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1.2, false)
	Gender:TweenPosition(UDim2.new(0, 0, 0.604, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1.2, false)
	Race:TweenPosition(UDim2.new(0, 0, 0.707, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1.2, false)
end)

4 comments

0

What's the most efficient way to do this?

0

There really isn't a better way except referencing some of the variables or properties

0

Make an attempt or look it up

0

Would go ahead and make a function to handle that, just to keep from writing all that 90 times

1 answer

You could make two variables with the EasingDirector Enums. With the EasingStyle Enum you could do the same. With time too.

Though, the best way I think would be to put all you stuff u want to tween and their end position, loop through them and tween.

This discussion is preserved as it was. New answers, comments, and votes are closed.