I'm trying to make a toggle UI like the one on this youtube(https://www.youtube.com/watch?v=mQTnB71NUAw&ab_channel=MaxShakurov").
This example uses a button UI to make this happen. But I'm trying to make it with a toggle UI that Unity provides.
But here is the problem that I faced.
Issue: There is a big difference in the interactable box size of what I expected.
Below is an example to make it easy to reproduce. My Unity version: 2018.4.23f1
My initial expectation was to make toggle UI to be able to interact with the size of its' target graphic.
How can you make a toggle UI to be able to interact on only the size of a target graphic?
The interaction space is expanded to any child object having a graphic element (Image
, Text
, etc) with Raycast Target
enabled.
All you have to do is
Go to the Label
object in the Hierarchy
Go to the Text
component in the Inspector
Disable the Raycast Target
checkbox
As a result you should now have only the checkbox itself interactive