Physics Question (Ragdoll buildings)

I am in the process of creating a Multiplayer FPS using Unity3 and Smartfox server. It uses SmartFox 2x’s FPS Example for a base. I would like to have buildings, trees, ect all be destructable when they get hit with an explosion. I am doing some testing with creating buildings in Unity out of cubes and attaching Ragdoll physics to them. I am then using the explosion framework to create a nuclear expolsion that exerts force on the Ragdoll buildings and they get blown apart. I am wondering however if this is the best way to go or if theres some other better way of creating destructable objects. What do you guys think?

Ragdoll is not suited for building physics. You rather might want to check out the physics integrated into Unity for that.
Building a house out of blocks … well … don’t know what the best approach would be to that sice I didn’t have had that kind of problem in my designs yet. But maybe you could come up with something different. Look at other games that had similar features like your game is going to have and if they have an editor check out how they did it.

http://unity3d.com/support/documentation/Manual/Physics.html

lol I meant Rigidbody not ragdoll

So rigidbodies don’t work correctly with Mesh Collision? When I add a rigidbody to a imported model that has mesh collision the model just falls right through the ground.

To first answer your last question, Rigidbodies do work with Mesh Colliders. However, a Mesh Collider can not collide with any other Mesh Colliders, unless at least one of them is Convex (255 tris or less I believe).
Now as for your first question, I’ve actually been working on a similar project for the past 4 months or so (online, multiplayer 3d person shooter with destructible environment). The way we decided to approach it is as follows:

  1. Create a prefab with a .FBX/ .OBJ of the building and a script in it.
  2. Have the script check it’s HP every time it’s hit.
  3. Once the HP reaches a value of 0 or less, GameObject.Destroy() it.
  4. In it’s place, Instantiate a second prefab containing (in our case) a static base (i.e.: foundations, concrete pillars, etc) and a bunch of chunks and shards. (These chunks should be added to an Empty GameObject.)
  5. Through script, iterate through all of the Empty GO’s children and add a Convex Mesh Collider and Rigidbody to each of them.
  6. After some time, destroy some chunks that are out of view to save on resources.

If you’re looking for a more dynamic kind of destruction, I Havok has released their source and there may be a way to integrate that into Unity. Not too sure on that though.