I’m getting this error
cannot read property ‘keyboard’ of undefined
const onTriggerData = function (pos, name)
{
console.log(pos, name);
if(this.app.keyboard.wasPressed(pc.KEY_Y)){
this.triggerPos = pos;
console.log('key y pos', this.triggerPos);
}
};
this.app.on('triggerData', onTriggerData);
I assume this.app not has scope?