Controller Overview
The Magic Leap 2's controller input can be accessed using Unity's Input System. The Magic Leap 2 SDK includes predefined action mappings, so developers can access controller input in a familiar way.
This section includes general information on Controller input and Controller Example scripts, including:
- API Overview - a summary of how to get started using the Magic Leap 2 Controller Input API.
- Reading Controller Input - demonstrates how to read the Magic Leap 2 Controller input values directly from the
MagicLeapInputs.ControllerActions
. - Controller Action Events - includes an example and information on subscribing to delegates that are called with the controller's input values changes.
- Tracked Pose Driver - A guide on setting up Unity's Tracked Pose Driver to mirror the controllers position and rotation.
- Migration Guide - Includes details on upgrading your Magic Leap 1 controller API to the Magic Leap 2.
To learn about the Magic Leap 2's controller hardware features, see the Controller Features guide.
📄️ API Overview
Controller API Overview
📄️ Controller Input Events
This section demonstrates how to use Unity's Input System to access input events from the Magic Leap 2 controller.
📄️ Controller Gesture Events
This section demonstrates how to use Magic Leap's Gesture subsystem to receive the input events that are triggered when the user performs a gesture on the controller's touch pad.
📄️ Controller Input Values
Using Unity Input System, you can read Magic Leap 2's controller input directly using the InputAction.ReadValue() method. View Unity's Documentation to learn more about Unity Input System Unity's Input System.
📄️ Controller Tracked Pose Driver
Unity Input System - Tracked Pose Driver
📄️ Migrating from ML1
Upgrade to Magic Leap's new Controller APIs