You need to watch your 'Elses'. You check for overlapping Enemy and set isAttacking to true. Then you separately check overlapping Crawling and if not, you set isAttacking back to false. And then you do the same for buildings. So unless you happen to be overlapping all three things at once, you are probably going to turn isAttacking off immediately. You need to clean up the logic so that if nothing is overlapping then you can set isAttacking back to false.