Setting frame position to mouse position is wrong

I have a script that sets the frame to the mouse position.
The frame has a anchor point of (0.5, 0.5) and even if i change it, it still does not work
Only the y position is wrong

image

local player = game.Players.LocalPlayer
local mouse :Mouse = player:GetMouse()

mouse.Move:Connect(function()
	
	frame.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
	
end)
1 Like

Try adding 36 pixels to the offset on the Y to compensate for the topbar

1 Like