Hi there,
I’m having a problem when I add multiple enemies, the behavior changes.
When I have single enemy, everything works fine. When I add multiple enemies, they end up not detecting collision on the walls or when the trigger exit takes place and they just keep walking to the right or in some cases, they get stuck in a back and forth animation lock. Screenshot below:
My enemy on the left, walks through the platform tiles and the other is locked in a back and forth animation.
Please note, I had to utilize the multiple collider method outlined in some of the other discussions surrounding the enemy behavior as the single “periscope” collider technique did not work for me.
Right now, I have three scripts for enemy movement - one for the movement itself. One for the wall collider detection, the other for the ground collider detection.
Script screenshots below:
Can someone please explain what the reasoning is for when I add another enemy into the level that the behavior changes.
I cannot figure it out.
Any help you could provide would be greatly appreciated!
Thank you!
Duncan