Changing direction on all objets that have same tag

So i have Three objects with same tag “Enemy” and they go to Right side…
When Third Enemy ( nearest to Line) touches line he starts function “Change Direction”
alt text
After that Third Enemy Changes Direction and First And Second goes to line to Start function
alt text
How do i make that any of the same tag owners touches the line, and All of them change direction at the same time?

many ways to do this… if they all move together all the time… just make the move script on a parent object instead of each of the invaders.

or… have a manager script with an array or list of all the invader objects… then you can access their scripts to set direction from the manager… or have any script tell the manager that one invader hit the wall. Just be sure to remove dead ones from the list.