I can’t use bash because I keep getting this error. I already beat this level, but want to figure out how this function works.
Do you have a shield equipped that can do bash? (Nevermind) I see you do.
This looks like Python? (This is a guess) line 7…don’t you need a variable to hold the distance?
You need to put an if enemy: around the block of code that passes in the enemy object because it doesn’t always exist
The problem is there is not always an enemy. you need to add the statement:
in front of all the commands you want to occur when you see an enemy. This is because you are trying to find the distance of a null target, and you cant target nothing and expect it to do something. If you don’t understand, I would go take a look at Patrol Buster.