Question by
whitesundreams · Feb 12, 2020 at 02:57 AM ·
gameobjectsceneactiveinactive
How to get all GameObjects in a Scene, including inactive GameObjects?
I am linking my question here to a solution that did not work for me.
http://answers.unity.com/comments/1699083/view.html
Supposedly I can do that using the functions given, but I get an error
ArgumentException: GetComponent requires that the requested component 'GameObject' derives from MonoBehaviour or Component or is an interface.
UnityEngine.GameObject.GetComponentsInChildren[T] (System.Boolean includeInactive) (at <cc5576c87a7f417dab467c626f1dc26d>:0)
MainMenuGameObjects.FindObjectsOfTypeAll[T] () (at Assets/RaindFiles/Scenes/MainMenu/Scripts/MainMenuGameObjects.cs:53)
MainMenuGameObjects.Start () (at Assets/RaindFiles/Scenes/MainMenu/Scripts/MainMenuGameObjects.cs:22)
How to get all GameObjects in a Scene, including inactive GameObjects?
Comment