unity hide object code example
Example 1: how to hide and show object in unity script
GameObject cat;
cat.SetActive(false); // false to hide, true to show
Example 2: hide button unity
GameObject button;
void Start() {
button = GameObject.Find("Button");
}
void ButtonClicked() {
button.SetActive(false);
}
Example 3: unity hide in inspector
[HideInInspector]
public float myVar;