Cleave not working

so whenever I do this.cleave(enemy); (enemy is always defined) it says ArgumentError is not defined even though I never even said anything simailer to argument error

Do you check if there is an enemy with if(enemy) {? If not, that’s your problem. this.findNearestEnemy() return null if there is no enemy when it is called, such as at the start of the world.

that’s what I do always.

Could you give us your code it might help us debug it

uh sorry I don’t know why but now it’s working :blush:

What did you do to get this to work