Skip to content

Commit 5c21268

Browse files
committed
fix(Interaction): ensure override buttons are reset correctly
When the override grab or use buttons are set and reset it also needs to call the ManageListeners method otherwise the override button will get reset to the wrong button if multiple touches on the object occur.
1 parent 236051c commit 5c21268

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Assets/VRTK/Scripts/Interactions/VRTK_InteractGrab.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ protected virtual void ControllerTouchInteractableObject(object sender, ObjectIn
262262
{
263263
savedGrabButton = subscribedGrabButton;
264264
grabButton = touchedObjectScript.grabOverrideButton;
265+
ManageGrabListener(true);
265266
}
266267
}
267268
}
@@ -275,6 +276,7 @@ protected virtual void ControllerUntouchInteractableObject(object sender, Object
275276
{
276277
grabButton = savedGrabButton;
277278
savedGrabButton = VRTK_ControllerEvents.ButtonAlias.Undefined;
279+
ManageGrabListener(true);
278280
}
279281
}
280282
}

Assets/VRTK/Scripts/Interactions/VRTK_InteractUse.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ protected virtual void ControllerTouchInteractableObject(object sender, ObjectIn
223223
{
224224
savedUseButton = subscribedUseButton;
225225
useButton = touchedObjectScript.useOverrideButton;
226+
ManageUseListener(true);
226227
}
227228
}
228229
}
@@ -236,6 +237,7 @@ protected virtual void ControllerUntouchInteractableObject(object sender, Object
236237
{
237238
useButton = savedUseButton;
238239
savedUseButton = VRTK_ControllerEvents.ButtonAlias.Undefined;
240+
ManageUseListener(true);
239241
}
240242
}
241243
}

0 commit comments

Comments
 (0)