:GetGuiObjectsAtPosition() returns an array. Arrays don’t have a key ‘Name’, which is why your code prints nil. If the function returned nil, you would get an error `“Attempt to index nil with ‘Name’”. If you want to do something with the returned guiObjects, you’ll need a loop.
for i, guiObj in ipairs(getGui) do
print(guiObj.Name)
end
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:Connect(function()
local MousePos = game:GetService("UserInputService"):GetMouseLocation() - game:GetService("GuiService"):GetGuiInset()
local getGUI = Player:WaitForChild("PlayerGui"):GetGuiObjectsAtPosition(MousePos.X,MousePos.Y)
for _, GuiObject in pairs(getGUI) do
print(GuiObject)
end
end)