Open colinfizgig opened 5 years ago
In the source code for the basic example you have...
scene.addEventListener('changeTask', function(evt) { var next = (keys.indexOf(AFRAME.currentInputMapping) + 1) % keys.length; AFRAME.currentInputMapping = keys[next]; mappingText.setAttribute('text', {value: 'Current mapping: ' + AFRAME.currentInputMapping}); logEvent(event); });
logEvent(event); should be changed to logEvent(evt); in order to work correctly.
or to keep it similar to the generic addEventListener function below it you could change it to
scene.addEventListener('changeTask', function(event) { var next = (keys.indexOf(AFRAME.currentInputMapping) + 1) % keys.length; AFRAME.currentInputMapping = keys[next]; mappingText.setAttribute('text', {value: 'Current mapping: ' + AFRAME.currentInputMapping}); logEvent(event); });
In the source code for the basic example you have...
scene.addEventListener('changeTask', function(evt) { var next = (keys.indexOf(AFRAME.currentInputMapping) + 1) % keys.length; AFRAME.currentInputMapping = keys[next]; mappingText.setAttribute('text', {value: 'Current mapping: ' + AFRAME.currentInputMapping}); logEvent(event); });
logEvent(event); should be changed to logEvent(evt); in order to work correctly.
or to keep it similar to the generic addEventListener function below it you could change it to
scene.addEventListener('changeTask', function(event) { var next = (keys.indexOf(AFRAME.currentInputMapping) + 1) % keys.length; AFRAME.currentInputMapping = keys[next]; mappingText.setAttribute('text', {value: 'Current mapping: ' + AFRAME.currentInputMapping}); logEvent(event); });