I want to create a button whose clickable area is only specified by a BoxCollider with Unity's new UI (similar to how you would do it from within NGUI). I can't get a Unity Button to work without the presence of an Image component (which ultimately represents the clickable area of the button).
Take the 2-minute tour
×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
There are two options for you. 1) Keep the image component on the button with a sprite, then set the transparency/alpha on the color to 0. 2) Write a separate script that you attach to a gameobject (Or image/button) that implements the Unity event interface: IPointerClickHandler and inherits from UIBehaviour. IPointerClickHandler is the interface Buttons use to register a mouse click. |
|||||
|
If I'm reading this correctly, I think all you need to do is remove the Sprite Renderer component(s) from the GameObject in question. Or -- what if you had a Sprite whose Alpha value was 0? Would that work? |
|||||
|