MixedRealityToolkit / MixedRealityToolkit-Unity

This repository holds the third generation of the Mixed Reality Toolkit for Unity. The latest version of the MRTK can be found here.
BSD 3-Clause "New" or "Revised" License
358 stars 91 forks source link

Capability to set custom cursor in MRTK 3 for far ray #58

Closed IssueSyncBot closed 12 months ago

IssueSyncBot commented 12 months ago

Original issue opened by:

@amea32179 amea32179


We could not set a custom cursor at runtime since Base Reticle and Reticle Root of MRTKBaseReticalVisual of MRTK Right Hand Controller of far ray is not accessible.


ISSUE MIGRATION

Issue migrated from: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/11702

IssueSyncBot commented 12 months ago

Original comment by:

@AMollis AMollis


If you are just wanting to change the reticle when hovering over an interactable, have you tried using the "custom reticle" property on the interactable itself. This will change the cursor when you hover over the interactable.

image

If you want to change the cursor, regardless of what interactable is being hovered, I recommend finding the BaseReticleVisual on the interactor, and call the BaseReticleVisual.AttachCustomReticle. This will hide the default reticle, and show your custom one. Note, as soon as you hover over an interactable with a custom reticle set, this will be cleared.

If you want to change the cursor regardless of what interactable is being hovered and without calling BaseReticleVisual.AttachCustomReticle, you'll need create a variant of the MRTK LeftHand Controller and change the Far Ray's reticle to your own game object. Your game object could then manage its own visual as it sees fit.

image

At this time, we don't believe it necessary to expose the underlying reticle game objects. If you have concerns or comments, please follow-up with this thread at https://github.com/microsoft/MixedRealityToolkit-Unity/discussions/11688