Canvas (Unity documentation) is the main UI component that enables interactive user interfaces in a Unity application.
To interact with UI elements (such as buttons and scroll bars) on this canvas, Unity provides a ray caster (GraphicRaycaster (Unity documentation) ). Out of the box, this component does not recognise VR controllers.
The Immerse SDK provides a feature to allow a VR user to interact with a world space canvas using the controller. When activated, a 'laser pointer' emanates from the index finger of the hand closest to the canvas. This pointer can then be used to interact with the canvas - pressing the controller trigger when the laser pointer is over a button activates that button, or holding down the trigger drags a scroll bar
- Before allowing controller input, a World Space canvas (Unity documentation) must be set up correctly.
When creating the canvas, take care when setting the scale properties, as this directly relates to the size of the canvas. If not setup correctly, with a high enough resolution, pixelation may occur on the text and textures in VR.
Add a GraphicRaycaster (Unity documentation) , for the controller input to work.
AllowControllerInputcomponent, once the canvas is positioned and sized correctly in the world space. This component will deal with the necessary calculations and steps to let the SDK handle input from the controllers.
Immerse SDK Class Library
More detail available in AllowControllerInput
|Is Distance Checking Enabled||If enabled, this will enable input for this canvas (the laser pointer) at a specified distance, if the controller is facing the canvas.|
|Distance In Meters||The distance in meters (radius from the Canvas position) to allow input|
Updated 4 months ago