setting things active/inactive

it just doesn’t make sense to me: i changed “true” to “false” to set things inactive, which works (setting them inactive i mean), but the making them appear code doesn’t do anything. and deathToll is increasing, also, these objects aren’t in hierarchies where children are being set inactive or anything like that, so that’s not the problem. here’s my code for both the appearing and not appearing:

public class DeathSet_Inactive : MonoBehaviour {

public int Num = 3;
// Use this for initialization
void Start () {
int dtoll = GameObject.Find(“DeathToll”).GetComponent().deathToll;
if (dtoll>=Num){
this.gameObject.SetActive(false);

}

}


public class DeathSetActive : MonoBehaviour {

public int Num = 3;
// Use this for initialization
void Start () {
int dtoll = GameObject.Find(“DeathToll”).GetComponent().deathToll;
if (dtoll>=Num){
this.gameObject.SetActive(true);

}

}

because the code is practically the same, i’m wondering if there’s something about how unity handles objects that are inactive before the scene loads that i don’t know about.

Maybe you could explain your scene setup. Are the objects instantiated or are they already in the scene? And if the code is the same, are the scripts attached both to one object or are they attached to different objects? If they are attached both, maybe it will set it inactive because the if statement is the same, or if they are already inactive, i think unity will not enter the script from within the inactive element.

“Start is only called if the script instance is enabled.”

So if the GameObject you attach DeathSetActive to is disabled, Start() won’t get called.
I think this is what happens, right?