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

Why does my tween not go to the position I want it too?

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

local Info = TweenInfo.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.58, 0},{0.455, 0});
	
}

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

wait(3)
ChangePositionTween:Play()

Position of scripts/gui: https://i.gyazo.com/86f951e6aad75429665382f43e9f2758.png

What happens: https://i.gyazo.com/9f5506d2fbd96dcb4496c79efeba6329.mp4

Where I want it to go: https://i.gyazo.com/f3758a76e3f29b7e801cc44c923899e9.png

I want the tween to go to the right position but it goes somewhere else.

1 answer

✓ Accepted answer

You're using a Script object. These normally shouldn't be used for handling GUIs, which are meant to be handled locally. Use a LocalScript and test out the code then.

That also isn't how you construct a UDim2. It may be confusing in the explorer, but you don't use tables. You just do UDim2.new(xScale, xOffset, yScale, yOffset).

3 comments

0

Yah I did that but it still does not work and am having the issue I stated

0

edited my answer

0

Tysm for the help dude! It worked!

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