I have been trying to block the movement and animation of the player when it performs a certain action, unfortunately I have not succeeded.
I have the following code in a script to communicate with the move script
InputTwo.prototype.onKeyDown = function(e) {
if(e.key===13){
if(this.chat_active===false){
this.element.focus();
this.chat_active=true;
this.app.fire('chat',true);
}
}if(e.key===27) {
if(this.chat_active===true) {
this.element.blur();
this.chat_active=false;
this.app.fire('chat',false);
}
}
Here in the script that controls the animation listens for the event but it does not have the expected effect. I suspect that you structure the code wrong
this.app.on('chat',function(bool=false){
if(bool===false) {
this.isControlling=true;
} else {
this.isControlling=false;
}
});
From already thank you very much