Title is pretty vague but it's all I could fit in the space provided. Basically I was following this tutorial to make a simple "back-and-forth" platformer enemy AI:
scirra(DOT)com/tutorials/828/adding-classic-style-movement-to-your-platform-enemies
The enemy works well, but I've run into an issue: whenever there is more than one instance of the enemy, they all no longer function. This is because every enemy relies on another sprite called "detector" that lets the enemy know when it needs to turn around and change its animation and when it should move forward. Every tick the detector is set to the position of an image point of the enemy that is slightly below and to the side of the enemy, and when it is no longer overlapping the ground, the enemy knows to turn around. However, the presence of more than one enemy means the detector is confused as to which imagepoint it should be set to, breaking the AI.
I know questions about UIDs and IIDs are probably asked constantly here, but I'm still having a hard time understanding them after looking up questions about them for a while. Basically what I'm trying to do is spawn one detector and assign one detector to the position of every instance of the enemy (Without making completely separate sprites and events for every enemy on the layout). One detector instance per enemy instance. Any help would be appreciated, I'd include a copy of the capx but it has a lot of extraneous stuff already and I'm not in a position to upload one anyway.