Search Unity

Resolved XR Interaction Toolkit OnSelectExit is never called

Discussion in 'XR Interaction Toolkit and Input' started by BentelAnnR, Jun 30, 2020.

Thread Status:
Not open for further replies.
  1. BentelAnnR

    BentelAnnR

    Joined:
    Jun 16, 2020
    Posts:
    5
    Hi all,

    I'm having some problems with the selection: while SelectEnter is correctly called by the InteractionManager, SelectExit is never called.

    I'm using the laser to select objects ("hover to select" field of XRRayInteractor set to true), the problem is: once an object is selected, I'm not able to select another object by interacting with it through the laser because the previous one keeps being in the selected state although it is no more hit by the laser.

    Debugging the application I've discovered that the SelectExit is never called by the InteractionManager, because the if statement of the following code is never passed, because interactor.selectTarget is set to null, for reasons I ignore, because interactor.selectTarget is correctly set in the selection phase.

    Code (CSharp):
    1.          void ClearInteractorSelection(XRBaseInteractor interactor)
    2.                  {
    3.                      // TODO: Make sure SelectExit is called if the selectTarget of the interactor is destroyed (and write a test around this).
    4.                      if (interactor.selectTarget &&
    5.                          (!interactor.isSelectActive || !interactor.CanSelect(interactor.selectTarget) || !interactor.selectTarget.IsSelectableBy(interactor)))
    6.                          SelectExit(interactor, interactor.selectTarget);
    7.                  }
    I'm quite sure I'm using the scripts the wrong way, so which is the correct way of enabling selection through the laser?

    Thanks in advance
     
  2. ddsim

    ddsim

    Joined:
    Oct 6, 2016
    Posts:
    6
    I'm having a similar problem. I created a custom Interactor and Interactable.
    OnSelectEnter
    is called one time for the first
    Interactable
    on the
    Interactor
    and the
    Interactable
    but
    OnSelectExit
    is never called.
     
  3. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    We believe this was a known issue that is now fixed in XRI 0.10 preview. More information can be found in our latest forum post as well as the changelog. If you're still having issues, please file a bug and the team will take a look. Thanks!
     
Thread Status:
Not open for further replies.