Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Poke interactor blocks other interactors when a UI button gets disabled while being poked

Discussion in 'XR Interaction Toolkit and Input' started by maria_unity852, Jan 9, 2024.

  1. maria_unity852

    maria_unity852

    Joined:
    Feb 16, 2022
    Posts:
    2
    My xr rig uses poke, direct, ray and teleport interactors in that priority order. When I'm poking a UI button and the UI gets disabled while being poked, all other interactors become unusable. I can't grab, raycst to or teleport until I poke another UI element.
    To sum it up, it looks like the poke interaction is left unresolved when the UI gets disabled.

    Disabling/renabling the poke interactor doesn't solve the issue.

    XR Interaction Toolkit v 2.5.2
    OpenXR plugin v 1.8.2
    Unity version 2022.3.10
     
  2. ericprovencher

    ericprovencher

    Unity Technologies

    Joined:
    Dec 17, 2020
    Posts:
    285
    Cheers for reporting this issue. We can look into it.
     
  3. ABISHJOHN

    ABISHJOHN

    Joined:
    Oct 19, 2023
    Posts:
    2
    I am also facing the same issue. Please update on this.
    unity 2022.3.7
     
  4. unity_1A8C24A0E9A2FCC2A46C

    unity_1A8C24A0E9A2FCC2A46C

    Joined:
    Jan 28, 2022
    Posts:
    14
    Last edited: Mar 4, 2024
    maria_unity852 likes this.
  5. ABISHJOHN

    ABISHJOHN

    Joined:
    Oct 19, 2023
    Posts:
    2
    I have updated XRInteractiontoolkit to 2.5.3 as well as 3.0.0-pre.2. Still this issue persists.
     
  6. njwpsu

    njwpsu

    Joined:
    Jun 10, 2022
    Posts:
    3
    2.5.3 solved the issue for UI that is disabled while being selected by the poke interactor but it does not consider UI that is being hovered. So the issue still exists.

    I haven't come up with a workaround but the issue comes from these two methods from 'TrackedDeviceGraphicRaycaster':
    Code (CSharp):
    1.         /// <summary>
    2.         /// Checks if poke interactor is interacting with any raycaster in the scene.
    3.         /// </summary>
    4.         /// <param name="interactor">Poke ui interactor to check.</param>
    5.         /// <returns>True if any poke interactor is hovering or selecting a graphic in the scene.</returns>
    6.         internal static bool IsPokeInteractingWithUI(IUIInteractor interactor)
    7.         {
    8.             foreach (var pokeUIInteractorSet in s_PokeHoverRaycasters.Values)
    9.             {
    10.                 if (pokeUIInteractorSet.Contains(interactor))
    11.                     return true;
    12.             }
    13.  
    14.             return false;
    15.         }
    16.  
    17.         /// <summary>
    18.         /// Validate interactor graphic raycaster data and ensure there is no stale data. Checks that the tracked device
    19.         /// graphic raycaster associated with the interactor is active and enabled.
    20.         /// </summary>
    21.         /// <param name="interactor">Interactor to validate.</param>
    22.         internal static void ValidatePokeInteractionData(IUIInteractor interactor)
    23.         {
    24.             if (interactor != null && interactor.TryGetUIModel(out var uiModel) &&
    25.                 uiModel.interactionType == UIInteractionType.Poke &&
    26.                 s_InteractorRaycasters.TryGetValue(interactor, out var graphicRaycaster) &&
    27.                 graphicRaycaster != null && !graphicRaycaster.isActiveAndEnabled)
    28.             {
    29.                     graphicRaycaster.EndPokeInteraction(interactor);
    30.             }
    31.         }
    Essentially `ValidatePokeInteractionData` needs to use `s_PokeHoverRaycasters` when checking for inactive graphic raycasters.

    Vote on the issue - https://issuetracker.unity3d.com/is...n-a-ui-button-gets-disabled-while-being-poked
     
  7. ericprovencher

    ericprovencher

    Unity Technologies

    Joined:
    Dec 17, 2020
    Posts:
    285
    I think we fixed again this in 2.5.4, and 3.0.1.
    The previous fix was incomplete.