Mass setting Rigid bodies to Is kinematic

Hey all,

I have been handed a model to act as a building in the level I am coding. I have set the rigid bodies and mesh collider and then made each 'is kinematic'. Yay! the character no longer runs through the walls!

But there is 2500 different polys making up this model. Highlighting them all and then ticking the box only effects one and applying it to the larger model rather than the polys has no effect.

Is there a way to mass set them to be is kinematic? Doing it one by one is taking a long time.

Thanks in advance

You should not need rigidbodies on static building geometry (in fact this is going to totally kill your performance). MeshColliders should be all that is needed. And those can be generated by the model importer, check the "Generate Colliders" checkbox on the asset.

Take a look at the wiki: MassSetMaterials

Maybe you can modify this script like this:

@MenuItem("Scripts/Mass Set isKinematic")
static function MassSetisKinematic() {
    Undo.RegisterSceneUndo("Mass Set isKinematic");
    for (var obj : GameObject in Selection.gameObjects) {
        obj.rigidbody.isKinematic = true;
    }
}