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 ManualDeclarationpublic void SetActive(bool value); Parameters Parameter Description value The active state to set, where
true
sets the GameObject to active and false
sets it to inactive. Description
Activates or deactivates the GameObject locally, according to the value of the supplied parameter.
SetActive
only sets the local state of the GameObject, represented by the value of GameObject.activeSelf. Changing the value of GameObject.activeSelf has no effect on the value of GameObject.activeInHierarchy if activeInHierarchy
is false
because of an inactive parent object.
Deactivating a GameObject disables each component, including attached renderers, colliders, rigidbodies, and scripts. For example, Unity will no longer call MonoBehaviour.Update on a script attached to a deactivated GameObject. Deactivating a GameObject also stops all coroutines attached to it.
Note: If the call to SetActive
changes the value of GameObject.activeInHierarchy, this triggers MonoBehaviour.OnEnable or MonoBehaviour.OnDisable on all attached MonoBehaviour scripts.
Additional resources: GameObject.activeSelf, GameObject.SetGameObjectsActive
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