Help me making a frame rotates and sizes according to other CFrame

Hi, I am trying to make like this:
But a Roblox FRame.
I don’t know what rotation should I place here.
how do I calculate rotation?
The size and position is already done :stuck_out_tongue:

Is the frame that you want to rotate the line between the other frames?. If that’s the case, then try something like this.

local frame1, frame2 = -- the other frames
local lineFrame = -- the line to rotate
local frame1Pos, frame2Pos = frame1.AbsolutePosition, frame2.AbsolutePosition
local angle = math.deg(math.atan2(frame2Pos.Y-frame1Pos.Y, frame2Pos.X-frame1Pos.X))
lineFrame.Rotation = angle
1 Like