aframe-speech-command-component
aframe-speech-command-component copied to clipboard
Call a function
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.