You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to have a for loop that detects if any of my imagebuttons have been hovered by the
mouse or not. -
What is the issue? Include screenshots / videos if possible!
For some reason when I hover the first imagebutton on my UIGridLayout it decides to execute
the event for all imagebuttons under that frame or affected by UIGridLayout. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’m honestly completely lost and thought I made some easy mistake somewhere but apparently not.
This is my current script:
for i,v in pairs(SelectFrame:GetDescendants()) do
if v:IsA("ImageButton") then
v.MouseEnter:Connect(function()
print("gg")
print(v)
local ButtonClone = v:Clone()
ButtonClone.Position = UDim2.new(0,v.AbsolutePosition.X,0,v.AbsolutePosition.Y + 37)
ButtonClone.Size = UDim2.new(0,v.AbsoluteSize.X,0,v.AbsoluteSize.Y)
ButtonClone.Parent = script.Parent.SelectedButton
v.Visible = false
end)
end
end