[Kinda Solved] Changing the Selectable Area of a Button

My goal is to have an invisible button positioned in front of a bunch of visible icons that do various animations when the button is pressed. However, I’m running into a problem: the area of the button that can actually be selected is smaller than the total area of the button object, and if the button is too small, none of the area is selectable.

This problem is particularly pronounced due to the fact that I’ve shrunk everything to 5% of its original size to improve performance for some of the really large objects in my game.

Thus, I’m wondering how one goes about changing the button area that can actually be selected? Ideally I’d want the entire rect transform area the button uses to be selectable.

Edit: After further debugging, it seems that the problem was that the button was being displayed using a UI camera, but the clicks were being registered based on whether the mouse was over the object’s position from the perspective of the main camera. So now I have to figure out how to trigger buttons from a secondary camera.

If I correctly understand the task, I would probably use the new UI system, create a Canvas, then optionally a Panel as a child and then a Button object as a child of the panel. And then parent images to a Button so you can control the size of the button and the children will always be within the bounds of the button.

Optionally you can also add Horizontal Layout to the Button object so the images will proportionally fill the space, and also you can control padding between them and offset around them.

Then you can either add on click event to the button in its inspector sending messages to animator controller

Please see screen shot for details

The easiest way I found was just to make the button a child of an image allowing you to resize the button without resizing the image.

If you just want to make the selectable area bigger add text as a child of the button.