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

How would I describe a GUIs position?

Asked by 5 years ago

Okay, so I have a script that is tweening in and out, how would I indentify the current position because it says positions is not a property of Scrollingframe.

Code:

if  playerGui.InfoPanel.ScrollingFrame:Position(0.5, -250,0.5, -200)

1 answer

Log in to vote
0
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago

Position of a GuiObject is a UDim2 type.

You are trying to access it as a function, but it is a property. A property can be accessed by using ., such as ScrollingFrame.Position. To check if the position is equal to something, you have to create a UDim2 to compare it to.

Here is what you could do:

if playerGui.InfoPanel.ScrollingFrame.Position == UDim2.new(0.5, -250, 0.5, -200) then

Hope this helps! :)

0
Yeah this didnt work for me. Car00071 11 — 5y
0
Try Vector2. If this doesn't work, then try rearranging your script cause either Vector2 or UDim2 should work. SBlankthorn 329 — 5y
0
You were correct!! Car00071 11 — 5y
Ad

Answer this question