Hi, I’m currently making a plugin which uses a movable GUI frame.
The movement works like this: the parent of all the objects inside the GUI is something called “mover” (the black square in the video). When the mouse zooms in, this code runs:
mover.Size += UDim2.fromOffset(100, 100)
mover.Position += UDim2.fromOffset((mover.Position - UDim2.fromOffset(widget.AbsoluteSize.X / 2, widget.AbsoluteSize.Y / 2)).X.Offset / (mover.Size.X.Offset / 100), (mover.Position - UDim2.fromOffset(widget.AbsoluteSize.X / 2, widget.AbsoluteSize.Y / 2)).Y.Offset / (mover.Size.X.Offset / 100))
I need it to zoom into the centre of the screen, but it currently zooms slightly towards the mover.
Any help is appreciated.