Problem with cloning a frame in the same position with a different anchor point

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to solve for anchor point so the anchor point stays 0, 0 on the frame i’m creating, while also having the same position of the original frame.

  2. What is the issue? Include screenshots / videos if possible!
    There’s a weird offset
    https://i.gyazo.com/9081d97d285429f0abeaa96798083d4b.mp4

frame = original frame
original frame anchor point = 0.5, 1

local shockwaveFrame = Instance.new("Frame")
shockwaveFrame.Size = frame.Size
shockwaveFrame.Position = frame.Position - UDim2.fromScale(frame.Size.X.Scale * frame.AnchorPoint.x, frame.Size.Y.Scale * frame.AnchorPoint.y)

Any reason you can’t just set the AnchorPoint on the cloned frame?

I want it to scale from the center, which is why i’m solving for anchor point

If you’re willing to use absolute positions you can use something like

local size = frame.AbsoluteSize
local pos = frame.AbsolutePosition
local shockwaveFrame = Instance.new("Frame")
shockwaveFrame.AnchorPoint = Vector2.new(0.5, 0.5)
shockwaveFrame.Size = UDim2.fromOffset(size.X, size.Y)
shockwaveFrame.Position = UDim2.fromOffset(pos.X + size.X / 2, pos.Y + size.Y / 2)
shockwaveFrame.BackgroundTransparency = 0.5
shockwaveFrame.Parent = script.Parent