Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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
    }
 
PREVIOUS NEXT
Tagged: #void #gameobject #setactive #unity
ADD COMMENT
Topic
Name
4+3 =