diff --git a/src/components/hand-tracking-controls.js b/src/components/hand-tracking-controls.js index b7460531717..dff0022c99b 100644 --- a/src/components/hand-tracking-controls.js +++ b/src/components/hand-tracking-controls.js @@ -167,12 +167,13 @@ module.exports.Component = registerComponent('hand-tracking-controls', { return function () { var jointPoses = this.jointPoses; var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller; - var i = 0; if (!controller || !this.mesh) { return; } this.mesh.visible = false; if (!this.hasPoses) { return; } - controller.hand.values().forEach(function (inputjoint) { + var inputjoints = controller.hand.values(); + for (var i = 0; i < inputjoints.length; i++) { + var inputjoint = inputjoints[i]; var bone = this.getBone(inputjoint.jointName); if (bone != null) { this.mesh.visible = true; @@ -181,7 +182,7 @@ module.exports.Component = registerComponent('hand-tracking-controls', { bone.quaternion.setFromRotationMatrix(jointPose); } i++; - }); + } }; })(),