Skip to content

Commit

Permalink
fix(Interaction): ensure touch state is reset on disable
Browse files Browse the repository at this point in the history
If an interactable object is touched and grabbed by one controller
but then another controller touches the object whilst it's grabbed
and then the object is disabled, the touch is not reset on the
original controller because it's not considered the touching obejct.

This fix ensures that the grabbing object and using object also
force the touch to be reset as well.
  • Loading branch information
thestonefox committed Jul 8, 2016
1 parent 3a55d1f commit 40fa577
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -304,11 +304,13 @@ public void ForceStopInteracting()

if (grabbingObject != null)
{
grabbingObject.GetComponent<VRTK_InteractTouch>().ForceStopTouching();
grabbingObject.GetComponent<VRTK_InteractGrab>().ForceRelease();
}

if (usingObject != null)
{
usingObject.GetComponent<VRTK_InteractTouch>().ForceStopTouching();
usingObject.GetComponent<VRTK_InteractUse>().ForceStopUsing();
}
}
Expand Down

0 comments on commit 40fa577

Please sign in to comment.