[2D gui camera] Move gui objects relative to a UDIM2 position

Hi, recently I got into making 2D gui games on roblox. However I faced that issue that I have little to know about making gui objects move relative to a position. Basically I would like to make a “camera”, that could follow the player around.

I have tried these ( They ran in RunService.RenderStepped ):

local vectorDir = PlayerFrame.Position - TestFrame.Position
TestFrame.Position += vectorDir --> makes the TestFrame go to the PlayerFrame
--TestFrame.Position -= vectorDir -> makes the TestFrame have inf position
TestFrame.Position -= PlayerFrame.Position
TestFrame.Position += PlayerFrame.Position

However none of them worked, because most of these just made the TestFrame have an infinite position.

Any help will be appreciated!

What is the style of game? Top-down or normal 2d? Are u uaing roblox-avatars or custom frame.

Sorry for the late reply.

I’m using guis, no roblox characters.

It’s normal 2D

After I got some help, this is what I got.

TestFrame.Position = UDim2.new(0, -PlayerFrame.Position.X.Offset, 0, -PlayerFrame.Position.Y.Offset)