Cleave not working


#1

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


#2

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.


#3

that’s what I do always.


#4

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


#6

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


#7

What did you do to get this to work