mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
Merge pull request #8684 from Menithal/controller-grab-unequip
Fixed HandcontrollerGrab distance unequip
This commit is contained in:
commit
7e4964db3e
1 changed files with 2 additions and 2 deletions
|
@ -2091,12 +2091,12 @@ 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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue