unity c# set gameobject active
gameObject.SetActive(true)
unity enable gameobject
GameObject.Find("PlayMenu 3").SetActive(false);
// you could also store a GameObject as variable
how to disable a gameObject unity c#
public GameObject gameObj;//the gameobject you want to disable in the scene
gameObj.SetActive(true); //set the object to active
gameObj.SetActive(false);//set the object to disable
gameObject.SetActive(true);//change the state of the current gameobject to active
gameObject.SetActive(false);//change the state of the current gameobject to disable
deactivate a gameobject unity
public void SetActive(bool value);
how to enable and disable gameobjects c#
public Gameobject test;
test.SetActive(false);
unity enable and disable gameobject
GameObject GO = GameObject.Find("GameObjectName");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us