Problem with colliders when turning isTrigger on / off

I am making a moonlander in unity where I am able to jump in and out of the moonlander. When i jump out I perform this code on the moonlander.

if( rigidbody.IsSleeping() )
{
    collider.isTrigger = true;
    gameTrackerLink.moonlanderExited();
    rigidbody.isKinematic = true;
    Debug.Log( "exited vehicle" );
}

Basically I activate my character, and set the moonlander's cockpit to a trigger, to be able to jump in again. Then when i jump in again i run this code:

if( other.name=="Character" )
{
    gameTrackerLink.moonlanderEntered();
    collider.isTrigger = false;
    rigidbody.isKinematic = false;
    Debug.Log( "entered vehicle" );
}

The problem is that somehow a child collider (the landing gear in this case), starts acting as a trigger, though the editor says it's not! Here's a build with the problem:

http://dl.dropbox.com/u/2610712/UnityAnswers.rar //arrow keys, down when on ground exits vehicle

I've located the problem in the code, and commenting away "collider.isTrigger = false;" will remove the bug (but the cockpit is still a trigger). I can't figure out what the real cause is, or if I can work around it. Any help is highly appreciated!

as a short term solution you can change the isTrigger property of the children. it seems that it's a bug. hopefully, it's not available in unity 3. i recommend reporting it.

example code to change the children's properties

javascript

for (var child : Transform in transform)
{
   child.collider.isTrigger = false;
}

C# code

foreach (Transform child in transform)
{
   child.collider.isTrigger = false;
}

technically speaking transform is an enumerable object. it returns the transform and all of it's children in iterations of the foreach loop.

if you need to change properties in components that they are not accessible in transform, you should use GetComponent.

I have run into this problem (trigger-once) before when I use Plane Colliders. If you are using a Plane Collider in this example, simply change the Collider to a Cube type collider, make it fairly thin, and see if it will trigger multiple times.

That's annoying bug.

have you tried simply iterating through all the children one parent collision and forcing their trigger off? (no idea if this'll work in the bugged state)

if( other.name=="Character" )
{
    gameTrackerLink.moonlanderEntered();
    collider.isTrigger = false;

    for (var child : Transform in transform) {
    child.collider.isTrigger = false;
}
    rigidbody.isKinematic = false;
    Debug.Log( "entered vehicle" );
}

Might be worth a shot to see if you can force it out of a trigger state. If not you could consider attaching a separate gameobject to your spaceship that acts as the trigger at all times.