I've made some enemy "AI" that's supposed to walk left and right and change direction when it's collides with an obstacle.
Problem is, sometimes the detectors fail and an enemy gets lost inside a wall.
Can anyone see what I am doing wrong?
You can download my file here
Hold "C" to create more enemies. The bug is more common when there are over 100 enemies, but not restricted to such high instance count.