find inactive gameobject by tag in unity3d

c#, unity-game-engine

Solution

After some research it seems that there is no way to find an inactive gameobject by tag.

solutions exist however to access inactive gameobjects:

1 - Store inactive game objects in an array if you need to reactivate them afterwards (only applies to game objects inactivated at runtime).

2 - Do not deactivate game object, simply deactivate the components you want inactive. If you wish to make the object disappear, deactivate the renderer. If it is a specific script, deactivate that script, etc.

This solution will allow you to still find a game object by its tag name.

Problem

I have a gameobject which I wish to activate given a certain condition. I gave it a unique tag and I tried using `GameObject.FindObjectWithTag("Tag name").` From what I can tell, this method will only find active gameobjects in the scene and not inactive ones. Is there a method that I can call that will also search inactive gameobjects? (Preferably searching by tag). Thanks!

Original source

Related problems