Download

What am I doing wrong on this overlap event?

c2c9068ffc2f1c3e71b90b453f187e12a3760f75.jpeg

Okay, so I have been working on a tower defense game similar to Plants Vs. Zombies. I have a grid set up and variables which check whether or not a weapon has been placed in each spot. I also have triggers on each space to detect where the enemies are overlapping. I have the above function checking to see if there is a weapon in the space and the enemy is overlapping said space. If it is, the enemy can then begin attacking the weapon. While the event is indeed firing, it doesn’t matter where on the grid the weapon is placed. The enemy will start attacking in whatever spot they are at. For example, I place a weapon on grid space “3A.” The enemy spawns to the right of “3I,” and begins walking to the left. Once it overlaps the first trigger (3I), it switches to the attacking animation, even though there is not weapon at this spot. Any idea how to fix this?