GameObject.active = true; Not Working, Need assistance.

Need help,I’m a bit confuse.

I code it like this,

  1. I put this code inside my game object so that when the game start it’s deactivated.
var ThisGameObject : GameObject;

function Start()
{
	ThisGameObject.active = false;
}

and after that what I did is this.

  1. I make a game manager so it check if my character have finished a conversation or not.after a conversation beetween character the object should active again.
var ThisGameObject : GameObject;

function OnLevelWasLoaded(level : int)
{
	if (level == 1) //Level LivingRoom 
	{
		if(ScriptDailogScene01.Fin == true)		
		{
			ThisGameObject.active = true;
		}
	}
}

but what happen now is, nothing happen. The object that I assign to active again did not active.

Where does the value for ‘ThisGameObject’ come from?

Sorry, can you elaborate the “Where does the value for ‘ThisGameObject’ come from”, I’m a bit slow or maybe I just don’t understand english that well :frowning:

‘ThisGameObject’ must have a reference assigned to it (via the inspector or through code), and I was just wondering where that assignment was coming from.

But, it may not matter. I’m not looking at the documentation right now, but if OnLevelWasLoaded() is executed before Start(), the object will be activated and then deactivated. Perhaps that’s the problem.

There’s a section in the documentation on function execution order; you might look for that section and see in what order OnLevelWasLoaded() is called with respect to Awake() and Start().