From 40fa57792b310b233aad4ce334809bde45346448 Mon Sep 17 00:00:00 2001 From: "Theston E. Fox" Date: Thu, 7 Jul 2016 18:36:06 +0100 Subject: [PATCH] fix(Interaction): ensure touch state is reset on disable 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. --- Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractableObject.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractableObject.cs b/Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractableObject.cs index 4d4a1a2e2..46680831f 100644 --- a/Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractableObject.cs +++ b/Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractableObject.cs @@ -304,11 +304,13 @@ public void ForceStopInteracting() if (grabbingObject != null) { + grabbingObject.GetComponent().ForceStopTouching(); grabbingObject.GetComponent().ForceRelease(); } if (usingObject != null) { + usingObject.GetComponent().ForceStopTouching(); usingObject.GetComponent().ForceStopUsing(); } }