setactive unity
gameObject.SetActive(true);
gameObject.SetActive(false);
setactive unity
gameObject.SetActive(true);
gameObject.SetActive(false);
doing void when gameobject setactive unity
void OnEnable() //This void works only when the script is enabled, but when the GameObject enables, the script does to so you can use for gameObject activating
{
Debug.Log("PrintOnEnable: script was enabled"); //Your code here
}
void OnDisable() //Same for the Disable function
{
Debug.Log("PrintOnDisable: script was disabled"); //Your code here
}
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