Keyboard input not working

I am a begginer to using PlayCanvas, and I made a small program that receives keyboard input to change the colour of a cube. However when I run the program using the editor, it will not work, as when I press the key ‘A’, on which the program is supposed to change the colour to the cube, nothing will happen.



Change:, this.onKeyDown,this);, this.onKeyUp,this);

To:, this.onKeyDown,this);, this.onKeyUp,this);

I changed those 2 lines, but it is still not working.

But your event functions are now firing, right?

There’s another problem. You have exposed two scripts attributes at the top of your script file. You need to:

  1. Select the Entity with the ‘test’ script applied.
  2. Hit the Parse icon. Your two script attributes will appear.
  3. Drag materials onto the script attributes.

2 posts were split to a new topic: Entity won’t move on a key press