Buttons are a feature in Unity that can be added to any project. Buttons allow users to trigger them and then an event will trigger in response. The events that are triggered are up to the developer to decide and customized based on their unique scenario. Buttons add a level of interactivity between user and AR/VR. Buttons can also simplify UIs where information is hidden until the button is triggered, creating a more readable and comprehensible user experience.
Meta Quest 3
Device setup for developing:
Unity installed
Additional set up tutorial: Set up Unity for XR development
Meta XR All-in-One SDK installed
Add as an asset to your Unity account
Once in Unity, navigate to Package Manager and install All-in-One SDK
Within the Hierarchy section, click the plus sign, and a dropdown menu will appear. Go to UI, then select Button - TextMeshPro.
In your scene, this will add a Button as a child to an existing Canvas. If a Canvas does not already exist, it will create a Canvas within your scene and then add the Button as the child.
In the Inspector, a Button can be customized including background color and text specifications.
To set the Button action when clicked, in the Inspector, go to the Button sub-section. Under On Click () you can add any actions to occur when the Button is clicked.
Unity Buttons documentation