I am making a turret defense game where players can place a wall to make the enemies walk further. However, when I want to delete a specific instance that blocks the enemies' path entirely, all the commands I have tried destroy all instances of the wall instead of the one right in the path. I am still learning the C2 language and do not have the best organizational/grouping skills with the language either. I've spent hours trying different options, downloading other examples, looking at suggestions on the forums, and nothing has worked, which leads me to believe this is a pathfinding issue and not a pick instance issue.
The method that I have made the most progress with is to create a global number that ticks everytime a wall is made along with and ID for each instance of a wall. Then I pick the last instance that was made and destroy.
See image below.
NumberOfDogwalls is the instance ID and NumberOfDogwallsGlobal is the global counter.
The specific code I am referring to is at the bottom of the L1-1 event sheet. The capx link is below. Again, any help with this issue would be greatly appreciated. Thanks.
<img src="https://dl.dropboxusercontent.com/u/103925639/CAPx/Untitled.png" border="0" />