How do I attach a GUI to a player's mouse?

for i, v in pairs(script.Parent:GetChildren()) do
	v.ChildAdded:Connect(function(Log)
		Log.MouseEnter:Connect(function()
			Log.HoverFrame.Visible = true
		end)

		Log.MouseLeave:Connect(function()
			Log.HoverFrame.Visible = false
		end)

		Mouse.Move:Connect(function()
			if Log.HoverFrame.Visible then
				Log.HoverFrame.Position = UDim2.fromOffset(UIS:GetMouseLocation().X,UIS:GetMouseLocation().Y)
			end
		end)
	end)
end

HoverFrame is following my mouse but from a far distance. How can I fix this?

Because it’s relative to the left corner, that is its desired behaviour. How far is this “far distance”? Because GetMouseLocation doesn’t account for Gui Inset, your mouse may appear a bit off the left corner of your frame. You would have to remove the Gui Inset by toggling the boolean property. “IgnoreGuiInset”. You could also center your frame using the anchor point, so your mouse is in the center.

Alternatively you could use the X and Y co-ordinates of your mouse instead of GetMouseLocation, using Udim2.new() over UDim2.fromOffset().