Hey, The problem I have is that I want to be able to set an area around the mouse to detect the GUI Button. With that I would be able to Detect more than One button at a time.
I’m working on an Inventory system and I need to detect more than one Slot.
For example having the mouse detection 2x2 unit instead of 1 pixel
I think he wants to basically make his mouse bigger so that he can click 2 GUI buttons at the same time, which I don’t think is possible, but you could script a mode where selecting a single item selects another item as well
If you want to be able to detect any size or shape of object, making the detection area bigger isn’t the way to go. Think about the situation where there might be an object that takes up the whole inventory. The mouse would have big enough to hit whole whole inventory from any point, or two times the height and width of the whole inventory. That works for the object that’s the size of the inventory, but is useless for smaller objects, because every object will be detected always.
If you want to continue down that path, you could try making larger, invisible buttons children of the buttons you have now. It’s going to make dragging logic more complicated, and I honestly don’t think it can really work.
What I’d do is make each inventory slot refer to either nil or a specific inventory object. When an item is dragged, all slots that refer to that item should clear their reference to nil. When an item is dropped into a slot, you’ll have calculate which other slots are overlapped by the item, and make all of them refer to that item. That way, clicking any slot that refers to an item will work for dragging the whole item.