VladPhonkie
(vForgottenVlad)
February 18, 2023, 12:31pm
#1
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
.
VladPhonkie
(vForgottenVlad)
February 18, 2023, 12:35pm
#3
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
2 Likes
VladPhonkie
(vForgottenVlad)
February 18, 2023, 12:40pm
#5
I’ve just found something,
VladPhonkie
(vForgottenVlad)
February 18, 2023, 12:40pm
#6
alright, I’ll try. Give me a few minutes, I’ll keep you updated.
VladPhonkie
(vForgottenVlad)
February 18, 2023, 12:42pm
#7
It works, thank you a lot for being of help!
1 Like
ch1s_x
(Chis)
February 18, 2023, 12:42pm
#8
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
)
system
(system)
Closed
March 4, 2023, 12:43pm
#9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.