Skip to content

Custom reticle not updating position at ray's end #11751

Answered by AMollis
nRammm asked this question in Q&A
Discussion options

You must be logged in to vote

You're adding the same game object to all interactors. Use customCursor as a prefab and create new instances of it. Also, you can probably change the code to not rely on MRTK3.

if (customCursor != null)
{
  foreach (var interactor in interactorCache)
  {
      var reticleProvider = interactor.transform.GetComponent<IXRCustomReticleProvider>();
      if (reticleProvider != null}
      {
         var instance = Instantiate(customCursor);
         reticleProvider.AttachCustomReticle(instance);
      }
  }
}

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@AMollis
Comment options

@nRammm
Comment options

@nRammm
Comment options

@AMollis
Comment options

Answer selected by nRammm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants