Unity3d Gameobject Find Inactive
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.
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine. Remember to check out for any 2D specific questions and conversation! Rules and Wiki Please refer to our Wiki before posting! And be sure to flair your post appropriately. Chat Rooms Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
Helpful Unity3D Links Related Subreddits Tutorials *Some content may require a registered account or paid subscription Misc. Resources CSS created by Sean O'Dowd, Maintained and updated by Reddit Logo created by from! Most of the time the best practice here is to have your deactivated GameObject inside of a container with a script on it. This script on this container can have a reference to the child object so that it can activate and deactivate it by reference directly rather than through a find.
Overall if you are using GameObject.Find() you may want to rethink how you are trying to access your game's objects. Usually there is a way to do it with references set in the inspector or through scripting by making your objects able to find one through a list or dependency that's created. Wavelab 5 Windows 7 Fix Problems here.
GameObject.Find() cannot be used to grab inactive gameobjects. Is there a way to grab an inactive game object and set it to active? Inactive GameObject at start of scene. Will be called if the script is inactive, not the GameObject holding the.
Once an object has been set inactive. GameObject.Find* methods should be able to find inactive objects. Scripting-Sep 01. GameObject.Find() cannot be used to grab inactive gameobjects. Is there a way to grab an inactive game object and set it to active?
Comments are closed.