GameObject.Find() not working when connected to prefab

I’m creating a game involving powerups. To spawn these powerups, I have a prefab of a powerup that is instantiated into the game every few seconds. The powerup I am currently testing is a powerup that spawns the walls around the edge of the screen when collided with. These walls prevent you from knocking your opponent off the platform and winning. However, it appears that only one instance of my prefab is usable at any one time, so colliding with a powerup will frequently not do anything (except give an error message) and leave the powerup there. The error message reads:

NullReferenceException: Object reference not set to an instance of an object
WallPowerup.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Scripts/WallPowerup.cs:21)

The line numbers pointed to give me reason to suspect this block of code:

void OnTriggerEnter (Collider other)
	{
		if (other.gameObject.CompareTag ("Player") || other.gameObject.CompareTag ("Comp")) {
			walls.SetActive (true);
			gameController.StartCoroutine (gameController.DestroyWalls ());
			Destroy (this.gameObject);
		}
	}

The walls variable is a GameObject set in the Start() function, with GameObject.Find(), and the line walls.SetActive(true) is the specific line the error message points to. Since the rest of OnTriggerEnter() isn’t functioning either, I think whatever error is going on manages to stop this specific instance of the script, but not any of the scripts in other instances of the same prefab.

GameObjects set Inactive when you use GameObject.Find() are not found.

try start scene with object activated, then add new line to your start function.

void Start()
{
     walls = GameObject.Find("GAME OBJECT NAME");
     walls.SetActive(false);
}

Other way to find gameObjects inactived on scene is searching a child Transform inactived on a active gameObject, gameObjects not active in scene are not found, but transform childs not active do it.

public GameObject wallParent;   // EMPTY ACTIVE GAME OBJECT
    public GameObject wall;         // YOUR OBJECT, CHILD OF wallParent AND NOT ACTIVE
	void Start ()
    {
        wallParent = GameObject.Find("WALL PARENT NAME");
        wall = wallParent.transform.Find("YOUR GAME OBJECT NAME").gameObject;
	}

I’m super late to the party but transform.Find works on inactive objects.
So what you can do is nest the inactive objects in an empty Game Object, then find that parent GameObject then find the inactive object

GameObject.Find("Main").transform.Find(gameObject).gameObject.SetActive(true);