How do I make a change to all instantiated versions of a game object through script?

So I started using Unity about 2-3 weeks ago, and right now I’m currently trying to make Flappy Bird just to familiarize myself with the basics. I’ve made it so that a script instantiates the wall game object at a random height every 2 seconds and makes it move left until it’s off screen, where it gets deleted. I’m currently trying to make it so if the player hits a wall, all walls not deleted will freeze, but when I tried to do that, it only made that change to the original version of the wall. How do I make that change to all clones of the wall?

If all the walls have a Tag, you can get all objects with tags with FindGameObjectsWithTag(string tag).

Even better, if you are instantiating each wall as they appear, you can add those to a List as you create them (and remove them as they are deleted) to cache them for later use. Then you can just loop through that list and do what you need without the overhead of searching the scene.