IF Statement returning false when it is clearly true

  1. What do you want to achieve?

I have a FOR loop that checks all the instance’s NAMES in a table of instances to see if they match the name of an instance.

  1. What is the issue?

Even if the name of the instance 100% equals the same instance’s name, it still returns false???

  1. What solutions have you tried so far?

I have tried everything I can think of, including printing everything to see if it’s somehow wrong(it isn’t)

Heres the block of code:

local PotentialSpaces = game.Players.LocalPlayer.PlayerGui:GetGuiObjectsAtPosition(MouseX2,MouseY2)
		
		for _, Frame in pairs(PotentialSpaces) do
			if Frame.Name == Hotbar.Slot1Frame.Name then

Maybe one of the names has a space in it and you just didn’t notice. What’s also possible is that you have an instance called “Name” in one of the frames.