So I'm making a tower defence game and added path finding on my monsters. I'm regenerating the path every time a new tower gets build. and this works. sort off. the problem is that some enemies still ignore the tower.
works as follows, monster is a family
-new tower build sets bool to true.
-when bool is true
-for each monster
-regenerate obstacle map
-find path to
-set bool to false.
now what I'm guessing is happening is that the first monster to find a new path sets the bool to false. making the other monsters follow their original path.
any idea on how to fix this?