Absolute Size Y Is Incorrect

When making my drag-and-drop frame I realized that the absolute position Y of the frame was off by 33 pixels consistently. Even when the ignoreguiineset is turned on the absolute position value is incorrect. However, when in the studio, not in the actual world, when I drag the same frame it properly shows that it is at 0.

It’s clear that the bug is related to the guiinset since even on different test devices the difference remains constant.

(I can’t post in the bug report for some reason…)

Are you talking about AbsolutePosition or AbsoluteSize? AbsolutePosition always start below the CoreGui topbar. If you want the drag-and-drop to be consistent, you should turn off .IgnoreGuiInset for the parent ScreenGui.

Because the topbar doesn’t exist in studio’s edit mode.

Sorry, you’re correct. Absolute position is what I meant to say. And I turned off the guiinset and it is still happening.

What are you using to get the mouse location? That also matters, because different methods will have different anchor points (from top-left of the entire screen or from top-left below the topbar).

I am using user input service’s GetMouseLocation.

That would be the issue. GetMouseLocation starts from the corner of the entire screen, but AbsolutePosition starts below the topbar, so the difference in Y would be the width of the topbar. You need to make them use a unified standard; how you do that is arbitrary but they should all start from one common location.

Attached is a demo for you to check out:
draggableFrame.rbxl (56.9 KB)

3 Likes

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