Tween goes to 0,0 instead of given UDim2

What I wanted to do:
I wanted to try to make a UI go to the corner of the screen using tween and UDim2

Issue:
Even thought I give the tween the position where the UI needs to go, it goes to {0,0},{0,0}*

What I’ve tried:
I have tried to re-paste in the position, and re-do it from the scratch, yet it does the same.

Variables:

local Notification = (Frame, it was declared properly...)

local Pos = UDim2.new(
		{0.796, 0},{0.596, 0}
	)

Code that seems to be the issue:
(No more code needed, that’s the only issue I have within my code.)

Notification:TweenPosition(Pos, Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 2)

This is most likely a scaling issue. Try using UDim2.fromScale, scaling your GUI using plugins and parent the GUI under an invisible frame named “Contents” with a size of 1, 1.

The frame is copied into a already existing ScreenUI called “Notis”, I think that may be the issue?

Remove the {} from both sets of numbers since you don’t do those when declaring UDim2s

You don’t use the offset values, so you can simplify that to UDim2.fromScale(0.796, 0.596), though both removing the {} and using fromScale in this case do the same

1 Like

I’ve just found something,
image

alright, I’ll try. Give me a few minutes, I’ll keep you updated.

It works, thank you a lot for being of help!

1 Like

When setting a UDim2.new() you cannot add {}, you have to add just the number so it would look like this:

local Pos = UDim2.new(
		0.796, 0,0.596, 0
	)

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