How do I customize cursor in MRTK?

Viewed 74

I'm struggling to find documentation on cursor customization in MRTK. Consider a plain simple scenario - I want custom cursor when I focus on certain object in the scene.

2 Answers

If you look into this official sample -- EyeTracking, the visual effects of the “cursor” when a user is looking at an object is simply switching the state of the background object (enable/disable). You may refer to the sample to customize the visual effects.

EyeTracking sample is not of much help, MRTK in fact does not provide available tools to customize cursor visuals. I see two options available:

  1. Implement custom BaseCursor similarly to how e.g. AnimatedCursor is implemented and create your own context info class similarly to how CursorContextInfo is done. This is how MRTK modifies cursor when focusing on resize and scale handles.
  2. Modify available pointer prefab, add your custom visuals into it and add a custom singleton script there. Use available focus on/off events on your content objects to modify cursor via singleton methods.
Related