Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make textlabel change position using tween service?

Asked by 3 years ago
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

0
TweenPosition and TweenSize Pupppy44 671 — 3y

1 answer

Log in to vote
0
Answered by
sngnn 274 Moderation Voter
3 years ago
Edited 3 years ago

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.

Ad

Answer this question