LinePointer, a base pointer class, draws a line from the source of the input (i.e. Each pointer prefab provided under Assets/MRTK/SDK/Features/UX/Prefabs/Pointers contains one of the pointer components attached. The following classes are the out-of-box MRTK pointers available and defined in the default MRTK Pointer Profile outlined above. A new custom prefab can be built as long as it contains one of the pointer scripts in Assets/MRTK/SDK/Features/UX/Scripts/Pointers or any other script implementing IMixedRealityPointer. MRTK provides a set of pointer prefabs in Assets/MRTK/SDK/Features/UX/Prefabs/Pointers. Handedness - allows for a pointer to only being instantiated for a specific hand (left/right) Pointers are only instantiated when a controller becomes available and in particular the Controller Type defines what controllers this pointer prefab can be created with.
Developers can utilize this list to reconfigure existing Pointers, add new Pointers, or delete one.Įach Pointer entry is defined by the following set of data:Ĭontroller Type - The set of controllers that a pointer is valid for. The list of pointers available to the system at runtime is defined under Pointer Options in the Pointer profile.
The default MRTK Pointer Profile configuration includes the following pointer classes and associated prefabs out-of-box. This may be useful to ensure Pointers interact with UI elements first before other scene objects. Pointing Raycast Layer Masks - This is a prioritized array of LayerMasks to determine which possible GameObjects any given Pointer can interact with and the order of interaction to attempt. Pointing Extent - Defines the max distance for which a Pointer can interact with a GameObject. The Pointer profile determines the cursor, types of Pointers available at runtime, and how those pointers communicate with each other to decide which one is active. This type of profile is assigned to a MixedRealityInputSystemProfile in the MRTK Configuration inspector. Pointers are configured as part of the Input System in MRTK via a MixedRealityPointerProfile.
#Unity custom mouse pointer windows#
For example, with the default pointer profile, Windows Mixed Reality controllers get both a line and a parabolic pointer for normal selection and teleportation respectively. More than one pointer can be attached to a controller. Pointers are instanced automatically at runtime when a new controller is detected.
#Unity custom mouse pointer how to#
This article explains how to configure and respond to Pointer input in practice, compared to Pointer Architecture