Skip to content

Commit 7550c10

Browse files
committed
fix(SnapDropZone): ensure valid object check is done at correct point
The valid object check was being done after a touched object was added to the valid snap object list, meaning that any object that was not valid but touching the object would cause the highlighter to display even if the object was not valid.
1 parent ba1f53e commit 7550c10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,10 @@ protected virtual void OnTriggerExit(Collider collider)
401401

402402
protected virtual void CheckCanSnap(VRTK_InteractableObject interactableObjectCheck)
403403
{
404-
if (interactableObjectCheck != null)
404+
if (interactableObjectCheck != null && ValidSnapObject(interactableObjectCheck, true))
405405
{
406406
AddCurrentValidSnapObject(interactableObjectCheck);
407-
if (!isSnapped && ValidSnapObject(interactableObjectCheck, true))
407+
if (!isSnapped)
408408
{
409409
ToggleHighlight(interactableObjectCheck, true);
410410
interactableObjectCheck.SetSnapDropZoneHover(this, true);

0 commit comments

Comments
 (0)