Problem with events

Note: The debugging tools that come with your browser really help tracking down issues like this. We have a page in our manual on this :slight_smile: http://developer.playcanvas.com/en/user-manual/scripting/debugging/

Also, I wrote the usual steps I take to investigate bugs like this in another thread which may be useful to you: [Solved] Error after make an add to the code

Onto your specific problem, using the debugger, I was able to find the script and the entity that was causing the problem:

This means that one of the scripts on this entity is causing the problem and the error of this type normally means that callback has been setup incorrectly in some way:

Looking at the script, I find the callbacks and noticed a slight issue:

Change it to this and that should fix it :slight_smile: Don’t forget to also fix EnemyAi.js as well.

MainCharacter.prototype.setSlowMotion = function(){
    this.setTime('slow');
    this.slowMo = true;
};

MainCharacter.prototype.setNormalMotion = function(){
    this.setTime('normal');  
    this.slowMo = false;
};