Skip to content

Commit

Permalink
fix(SnapDropZone): ensure valid object check is done at correct point
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thestonefox committed Nov 17, 2017
1 parent ba1f53e commit 7550c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs
Expand Up @@ -401,10 +401,10 @@ protected virtual void OnTriggerExit(Collider collider)

protected virtual void CheckCanSnap(VRTK_InteractableObject interactableObjectCheck)
{
if (interactableObjectCheck != null)
if (interactableObjectCheck != null && ValidSnapObject(interactableObjectCheck, true))
{
AddCurrentValidSnapObject(interactableObjectCheck);
if (!isSnapped && ValidSnapObject(interactableObjectCheck, true))
if (!isSnapped)
{
ToggleHighlight(interactableObjectCheck, true);
interactableObjectCheck.SetSnapDropZoneHover(this, true);
Expand Down

0 comments on commit 7550c10

Please sign in to comment.