AbsolutePosition error?

This doesn’t usually happen to me but —

	local OriginalPosition = MainFrame.AbsolutePosition
	print("A:",MainFrame.Position.X, "B:", OriginalPosition.X)

Prints out:

A: 0, 546 B: 296

Why is B a different number from A when it’s supposed to be the AbsolutePosition (In pixels) form rather than scalar?

Yes I know that – but why is it that the offset for A is different from B?

local OriginalPosition = MainFrame.AbsolutePosition
print("A:", MainFrame.Position.X, "B:", MainFrame.AbsolutePosition.X, "C:", OriginalPosition.X)

prints out

A: 0, 546 B: 296 C: 296

B and C are supposed to print out as 546 not 296? I don’t know where that number came from

Edited: P.S MainFrame’s Parent is ScreenGui, which cannot be moved or scaled which furthermore does not make up why the AbsolutePosition is different from the position itself

The frame’s position and its absolute position are two very different coordinates. The absolute position represents its true position on the user’s screen in pixels, whereas the position represents its relative position from the origin of its parent GuiObject. The only scenario where these two properties align is when the GuiObject in question is a direct child of a ScreenGui

Edit: If you say that is the case, then I am not sure what to say in response. Please show us more, maybe there’s something you’re misinterpreting

Screenshot 2025-03-25 at 11.59.46
As I stated before, the MainFrame is a direct child of the ScreenGui which is why I was confused in the first place

“Please show us more, maybe there’s something you’re misinterpreting”

All of these affect where your children’s absolute position will start at
ScreenInsets
IgnoreGuiInset
ClipToDeviceSafeArea
SafeAreaCompatibility

&
AnchorPoint

Heres a really basic snippet
AbsolutePositionError.rbxl (68.3 KB)
Just Play, click where it says in bold CLICK HERE

Yeah, you’ve adjusted your anchor point to 0.5, 0.5. This will offset the absolute position from the position

Oh wait my bad guys :sob: I forgot. All I needed to do was

print("B:", OriginalPosition.X + MainFrame.AbsoluteSize.X/2)
1 Like

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