Activate / Deactivate objects onTriggerEnter / Exit

Hi,

I have read a few threads with this topic, but currently I am confused, especially since in Unity 4 setActive() now seems to affect children too.

I want to ask this in a very very basic way.

Suppose I have a gameobject marking a section of my scene. It has children. I want to activate the children only onTriggerEnter. Similarly, I want to deactivate (or even destroy) all children onTriggerExit.

Another thing. Ideally, the script which has onTriggerEnter also would have an awake function which deactivates all children by default. This way, when I enter game mode, everything but the first section is deactivated. awake should run before start, so all children should be deactivated before their start() can run.

Alternatively, if this gets too complicated, I’ll probably make many scenes. This breaks the experience a bit though.

I am having the same problem and I think that you should do the other scene trick. Thats what i’m doing and it came out great!

You could have seperate scenes and merge them in with:

Application.LoadLevelAdditive (1);