Toggles are a UI feature in Unity that can be added to a project. Toggles are like switches, they have an on and off state. The developer can customize what these on and off states are and what other objects may be effected by the toggle. Multiple toggles can be put together in a Toggle Group where when one toggle is turned on, the developer can customize if other toggles in the group are turned off or also turned on. They add an extra layer of user interaction and can allow users to have some control over their visualization.
Meta Quest 3
Device setup for developing:
Unity installed
Additional set up tutorial: Set up Unity for XR development
Within the Hierarchy section, click the plus sign, and a dropdown menu will appear. Go to UI, then select Toggle.
In the Inspector, a Toggle can be customized including background color and graphic.
To set the on and off state of the toggle, go to On Value Changed (Boolean). The value set here is what defines the states.
If you want to have multiple toggles and have their states relate to one another.
Add a Parent Group Object.
Then, add the Toggle Group Component.
The Toggles to be part of the group should be child elements of the Parent Group Object.
For each toggle, go to the Inspector and under Group, select the Toggle Group object just created.
Now, you can customize how you would like. This can include having only one toggle able to be in the on state at once.
Unity Toggles documentation
An in-depth YouTube video on how to set up toggles in Unity: