Question by
unity_dXsh13TorSPcVA · Sep 04, 2021 at 08:43 PM ·
disableuser interfacecreatehideuser
Hide GameObject without completely disabling it
I cannot figure out how to hide my GameObject
when a button is pressed without completely disabling it. I'm trying to keep my creating user calc continuing but keeps stopping as it is inactive.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RegisterUserToHome : MonoBehaviour
{
public GameObject HomePage;
public void whenButtonClicked()
{
if (HomePage.activeInHierarchy == true)
HomePage.SetActive(false);
else
HomePage.SetActive(true);
}
}
Comment