var SlowMo = pc.createScript('slowMo');
// initialize code called once per entity
SlowMo.prototype.initialize = function() {
};
// update code called every frame
SlowMo.prototype.update = function(dt) {
if(this.app.keyboard.isPressed(pc.MOUSEBUTTON_RIGHT)){
this.app.timeScale = 0.4;
} else {
this.app.timeScale = 1;
}
};
// swap method called for script hot-reloading
// inherit your script state here
// SlowMo.prototype.swap = function(old) { };
// to learn more about script anatomy, please read:
// http://developer.playcanvas.com/en/user-manual/scripting/
I want the key E to be left click on the mouse. How do I do this?