Search Issue Tracker

Fixed in 1.0.0-pre.6

Votes

1

Found in [Package]

1.0.0-pre.4

Issue ID

1340469

Regression

Yes

[XR Interaction Toolkit] XRSocketInteractor does not interact with XRGrabInteractable after modifying socketActive property

Package: XR Interaction

-

Reproduction steps:
1. Open the user's attached "Socket.zip" project
2. Load SampleScene
3. Enter Play mode
4. Press Space on the keyboard to spawn a cannonball
5. Press and hold the Left Arrow key until the cannonball reaches the red cube on the left side
6. Press Space to shoot the cannonball
7. Repeat steps 4 and 5

Expected result: the cannonball is attached to the cube
Actual result: the cannonball is not attached to the cube

Reproducible with: XR Interaction Toolkit 1.0.0-pre.4 (2019.4.28f1, 2020.3.12f1, 2021.1.10f1, 2021.2.0a19)
Not reproducible with: XR Interaction Toolkit 1.0.0-pre.3 (2019.4.28f1, 2020.3.12f1)
Could not test with 2018.4 (XR SDK not available)

Note: after exiting the red cube with the Left or Right Arrow keys the XRSocketInteractor can again interact with XRGrabInteractable

  1. Resolution Note (fix version 1.0.0-pre.6):

    This bug was due to an issue where Interactables were not added to the valid targets list of Direct and Socket Interactors when the Interactable was registered after it had entered the trigger collider of the Interactor, and was fixed in 1.0.0-pre.6 of the package. Interactable objects are automatically registered and unregistered with the XR Interaction Manager during their OnEnable/OnDisable methods, which are also called when the GameObject is activated/deactivated.

    The reproduction project submitted with this bug would still need code additions to do what the user expects. They are deactivating the Ball GameObject as they move it away from the Socket, but that means the OnTriggerExit method won't get called on the Socket. As soon as the Ball is activated after firing, it would snap back to the Socket since it would become a valid target again since the event of exiting the trigger was not recorded. The user would need to edit the Cannon's OnSelectExited method to iterate over the colliders and call OnTriggerExit to record the fact that the Ball has exited before moving to storage. The Direct and Socket Interactors use those event methods rather than polling each frame to determine which objects are touching.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.