Search Unity

Question This code snippet breaks snapping into sockets.

Discussion in 'XR Interaction Toolkit and Input' started by SeanBannister, Apr 6, 2021.

  1. SeanBannister

    SeanBannister

    Joined:
    Jul 13, 2020
    Posts:
    23
    Very new to Unity and C# so excuse my lack of knowledge.

    I'm using XR Interaction Toolkit, by default you can't grab the edge of an interactable and have it stay in that position as it snaps its position and rotation so its centered. I posted a code snippet here which fixes the problem and allows objects to be precisely grabbed.

    The problem is it breaks snapping into sockets. When you place the interactable near the socket it just stays in position rather than snapping into the socket position. I'm having trouble fixing this, I'm not really sure where to get started, could someone please give me some direction, I'm unsure if I should be looking to override something in XRGrabInteractable or XRSocketInteractor.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Hey @SeanBannister! Wanted to pass along that this is a feature request that will be in an upcoming verified version of XRI, but I don't have an ETA on that.
     
    SeanBannister likes this.