function getPosition(parent: GuiBase2d, pos: Vector2)
if parent:IsA("GuiBase2d") == false or parent:IsA("ScreenGui") == true then
return pos
end
pos = pos - parent.AbsolutePosition
return getPosition(parent.Parent, pos)
end
help w my code please how do i get the absolute position of a nested element relative to the screen? object.AbsolutePosition returns a position relative to it’s parent
object.AbsolutePosition returns a position relative to it’s parent
Are you sure it does? I thought it was absolute relative to the screen.
Otherwise, you just need to keep adding the AbsolutePosition of the element and its parent and its parent until you reach a ScreenGui object.