Hi, i am newly on Playcanvas i have write below code in my editor, but when i am going to launch my project, and pressed key right its not working, anyone can check and tell me please, where i am wrong?
pc.script.create('move', function(app){
var Move = function (entity){
this.entity = entity;
};
Move.prototype = {
initialize: function () {
},
update: function (dt) {
if(app.keyboard.isPressed(pc.input.KEY_RIGHT)){
this.entity.translateLocal(0.1,0,0);
}
}
};
return Move;
});