From a6040197ebad09cf61b7d243193eb56a8fadeede Mon Sep 17 00:00:00 2001 From: Menithal Date: Thu, 29 Sep 2016 21:55:58 +0300 Subject: [PATCH 1/2] Fixed HandcontrollerGrab unequip. Will now use deltaTime and a second instead of instantly disconnecting on if more than 0.1 off. This is to avoid accidental disconnection due to acceleration and latency --- scripts/system/controllers/handControllerGrab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 05edcdad03..6eaaf11f8a 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -2098,7 +2098,7 @@ function MyController(hand) { var TEAR_AWAY_DISTANCE = 0.1; var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props); if (dist > TEAR_AWAY_DISTANCE) { - this.autoUnequipCounter += 1; + this.autoUnequipCounter += deltaTime; } else { this.autoUnequipCounter = 0; } From 4bed3ee036cddeca2efe03b3cc1d64f616381d72 Mon Sep 17 00:00:00 2001 From: Menithal Date: Sat, 8 Oct 2016 01:36:57 +0300 Subject: [PATCH 2/2] Adjusted theoretical Unequip time to 250 ms --- scripts/system/controllers/handControllerGrab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 6eaaf11f8a..ecda04321f 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -2103,7 +2103,7 @@ function MyController(hand) { this.autoUnequipCounter = 0; } - if (this.autoUnequipCounter > 1) { + if (this.autoUnequipCounter > 0.25) { // for whatever reason, the held/equipped entity has been pulled away. ungrab or unequip. print("handControllerGrab -- autoreleasing held or equipped item because it is far from hand." + props.parentID + ", dist = " + dist);