Search Unity

Bug Gesture Interactor GetValidTargets has issues

Discussion in 'XR Interaction Toolkit and Input' started by danUnity, Mar 27, 2021.

  1. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Hi,

    The GetValidTargets method on the Gesture Interactor is not accurate. There's even a comment saying that if the camera is directly over/under object it will fail.

    Right now if the camera is up and close to the interactable, it won't add it to the valid targets even though it's fully visible in the camera frustum.

    Also, it only adds an interactable to the list of valid targets if the CENTER is in the frustum which is incorrect. As soon as an interactable is even remotely visible to the camera, it should be added to the valid targets list since the user still sees it visually.

    Also the GestureInteractor is using an internal property of the InteractionManager called interactionManager.interactables but it should be using the public method called GetRegisteredInteractables.

    I wouldn't assume you have access to the internal methods in any of your interactable/interactor scripts. Otherwise it becomes hard for people just like me to extend those scripts...


    Cheers,
     
  2. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    231
    Thank you for the bug report, issue 1354009 has been created to track this.

    As a workaround, you can override the
    ARGestureInteractor.GetValidTargets
    method to include all registered interactables of type
    ARBaseGestureInteractable
    rather than doing the filtering it is doing now. That behavior no longer uses an internal property in newer versions of the package, it uses the public
    GetRegisteredInteractables
    method to iterate the interactables.