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

How to get the position of a GUI object that has UIListLayout?

I have a simple example of a GUI, the layout is as follows:

- ScreenGui
	- Frame
		- UIListLayout
		- SubFrame1
		- SubFrame2
		- SubFrame3

The position of each SubFrame is locked by the UIListLayout, so the .Position property will always be a Vector3 of (0, 0, 0, 0).

I want to create a new frame based on the relative position of the SubFrame (inserting children into the SubFrame is not an option).

Is there a way of getting the position of say, SubFrame3?

1 answer

✓ Accepted answer

You could retrieve this by doing SubFrame3.AbsolutePosition. Remember that this will give you a Vector2 with X, Y values in screen offset.

You could convert this to scale measurements (based on the parent frame size) by doing SubFrame3.AbsolutePosition.X/Frame.AbsoluteSize.X.

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