I am attempt to make my iamge button being able to be dropped inside one of 5 slots but for some reason when it disconnects and prints out the mouseObjectTable the table is empty even though my mouse is directly above a UI Element.
local connection
connection = UserInputService.InputEnded:Connect(function(input, gameProccessedEvent)
if input.UserInputType == Enum.UserInputType.MouseButton1 and gameProccessedEvent then
frame = false
clone:Destroy()
PetSlot.ImageTransparency = 0
viewportClone.Visible = true
connection:Disconnect()
local mouseObjectTable = StarterGui:GetGuiObjectsAtPosition(
UserInputService:GetMouseLocation().X - GuiService:GetGuiInset().X,
UserInputService:GetMouseLocation().Y - GuiService:GetGuiInset().Y
)
print(mouseObjectTable)
end
end)