Convert GUI Position To Relative Of Another GUI

Screenshot_20221216_123844

Let’s say the RedGUI’s parent (ScreenGUI) is WorldSpace; how can I convert the RedUI’s position from “WorldSpace” to the WhiteGUI’s “ObjectSpace”?

Hi, is the RedGUI always on the screen?

Also is it a minimap you’re trying to create, or what is your goal here?

No, the RedGUI might not always be on screen, and to sum up your question; essentially I want to get a vector from WorldToScreenPoint() and position the RedUI to the converted vector3, but the UDIM2 value wouldn’t be relative to the WhiteGUI of course.

Do you mean something like this?

local relativePos = RedGUI.AbsolutePosition - WhiteGUI.AbsolutePosition

-- as udim
local relativeUDim = UDim2.fromOffset(relativePos.X, relativePos.Y)

Um, no I was not referring to that nor does it even work as intended, but I’ve already found a workaround for now.

I love the Roblox Devform, guaranteed help with in seconds! :skull:

What did you mean and what is your workaround?

For people that might find this in the future.

Believe me, no one would need my workaround due to it being such a specific case.

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