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

How would I describe a GUIs position?

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

✓ Accepted answer

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! :)

3 comments

0

Yeah this didnt work for me.

0

Try Vector2. If this doesn't work, then try rearranging your script cause either Vector2 or UDim2 should work.

0

You were correct!!

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