So my code needs to move a frame to the same position as another frame without reparenting.
The reason why reparenting won’t work is because you’ll be able to drag the frame off of the parents and sometimes the parent frames have clip descendants and obviously won’t show the dragged frame.
The code I’m using in a test place is exactly this
local Frame = script.Parent:FindFirstChild("Frame1", true) -- White frame
local Frame2 = script.Parent:FindFirstChild("Frame2", true) -- Red frame
Frame2.Position = UDim2.fromOffset(
Frame.AbsolutePosition.X - Frame2.Parent.AbsolutePosition.X,
Frame.AbsolutePosition.Y - Frame2.Parent.AbsolutePosition.Y
)
The results I want should look like
The results I am getting looks like
It’s not perfectly aligned like the first one and has a small offset which can be problematic.