> This seems extremely complicated. Can you explain what you want? I get the general idea, but specifically, how should this work?
When you get in his line of sight, He fades away, gets right behind you and fades back in and attacks. After that he fades back out, goes back to where he started, then fades back in. The only problem is that once the whole cycle starts again, he stays invisible after he fades out.
i didnt opened your capx, but here is my own version of unexpected behavior AI
the AI is by default patrolling, then the last move=4 is what is triggering the unexpected fade out/in and action (whenever the player enters the enemy distance of patrolling by 100 pixels then AI spots him and unexpectedly stabs him in the back.
then if your player wold have something like a bullet shot at it, you wold compare if enemy.move<4 or not equal with 4 then trigger your usual life lose on enemy, else miss.
however the code is getting stuck not sure why, ATM but as a example should do the trick so you can understand how you can use proximity and visual effect with opacity.