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

How to make textlabel change position using tween service?

local TweenService = game:GetService("TweenService")
local label = script.Parent

local Info = TweenService.new(
	5,  --Length
	Enum.EasingStyle.Sine, --Easing Style
	Enum.EasingDirection.Out,  --Easing Direction
	0, --Times repeated
	false, --Reverse
	1 --Delay (seconds)
)

local Goals = 
{
	Position = UDim2.new ({0.54, 0},{0.359, 0});
	
}

local ChangePositionTween =TweenService:Create(label,Info,Goals)

wait(3)
ChangePositionTween:Play()

Layout: https://i.gyazo.com/011f7d0f8baebd83a09ee9c93a2b0a54.png

I am trying to make the text label change position using the tween service

1 comment

0

TweenPosition and TweenSize

1 answer

Your code is fine. You just mixed up a word. Instead of using TweenInfo.new, you used TweenService.new.

By the way, you don't need to go through all that to tween positions. You could instead just use TweenPosition.

gui:TweenPosition(UDim2,EasingDirection,EasingStyle,Time,Override,Callback)

And there's no need to put the {},{} in your UDim2s. It's unnecessary.

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