Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close Submission failedFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close Your name Your email Suggestion* Switch to Manual Declarationpublic static
GameObject Find(string
name);
Parameters Parameter Description name The name of the GameObject to find. DescriptionFinds and returns a GameObject with the specified name.
Only returns active GameObjects. Returns null
if no GameObject with name
exists. If name
contains a /
character, it traverses the hierarchy like a path name.
For performance reasons, it is recommended to not use this function every frame. Instead, cache the result in a member variable at startup, or use GameObject.FindWithTag.
If the game is running with multiple scenes then Find
will search in all of them.
To find a child GameObject, it is often easier to use Transform.Find.
GameObject.Find
is useful for automatically connecting references to other objects at load time; for example, inside MonoBehaviour.Awake or MonoBehaviour.Start.
A common pattern is to assign a GameObject to a variable inside MonoBehaviour.Start, and use the variable in MonoBehaviour.Update.
Additional resources: GameObject.FindGameObjectsWithTag
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4