aframe-speech-command-component icon indicating copy to clipboard operation
aframe-speech-command-component copied to clipboard

Call a function

Open bknill opened this issue 6 years ago • 0 comments

Any clues how to call a function?

I'm trying something like this

const commandFunction = () => {console.log('command')}

    const command={
      command:text,
      type: 'function',
      function : commandFunction,
    }

        <Entity
          voice-command={command}
          position-curved-images={positionCurvedImage}
          primitive='a-curvedimage'
          {...geometry}
          className='clickable'
          {...{events}}
        >
        </Entity>

But get this error: Cannot read property 'executeCommand' of undefined

Uncaught TypeError: Cannot read property 'executeCommand' of undefined at Object. (index.js:94) at annyang.min.js:8 at Array.forEach () at u (annyang.min.js:8) at z (annyang.min.js:8) at SpeechRecognition.e.onresult

bknill avatar Mar 18 '18 23:03 bknill