Skip to content

Commit

Permalink
fix: offset when grabbing multiple objects with attach points (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Quiroz committed Nov 27, 2020
1 parent 49e1dd4 commit 5353f6a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Runtime/Interaction/DirectInteractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,20 @@ protected override void OnSelectEnter(XRBaseInteractable interactable)

base.OnSelectEnter(interactable);
}

/// <summary>
/// This method is called by the interaction manager when the interactor ends selection of an interactable.
/// </summary>
/// <param name="interactable">Interactable that is no longer selected.</param>
protected override void OnSelectExit(XRBaseInteractable interactable)
{
base.OnSelectExit(interactable);

if (precisionGrab)
{
attachTransform.localPosition = initialAttachPosition;
attachTransform.localRotation = initialAttachRotation;
}
}
}
}

0 comments on commit 5353f6a

Please sign in to comment.