Colliders on a single complex object

Hi there,

Disclaimer: Im very much a Unity noob, so please bear with me…

I have created a simple room in Blender, the room has several doors, windows, many walls and a floor. In Blender, I created this as a single object, which I then UV unwrapped, textured, imported into Unity and looks exactly how I wanted it to. Happy days!

Now, as a test, I instantiate a cube when the left mouse button is clicked and add a velocity to simulate a poor mans ‘throw a box’. Obviously, as the walls dont have box colliders, the cubes go straight though. Here in lies the problem. Because my room is 1 object (it has no children, sub-objects, etc), if I add a box collider, then the collider encompasses the whole room, not the individual walls and, as I cant add multiple colliders to the same object, its left me kinda puzzled.

The obvious next port of call was the mesh collider, but, as I will be targeting my game for mobile, from reading (lots) on these forums, it seems clear that the mesh collider should be avoided on mobile. (please correct me if Im wrong here).

I had the thought that I could create many Empty Gameobjects, move them to the right place (walls, floors, etc), add colliders to them and size the colliders. But this really seems like a huge amount of work, especially for games like Angry Bots, where the level is rather large. [As a side note, I did download and install Angry Bots, only to find exactly what I described above, hundreds and hundreds of colliders, all grouped into 1 Empty Gameobject.]

Im now thinking some sort of editor script might help here… Loop through all the vertices on an object, find parallel edges, max/min vertices, etc to determine wall positions and automagically create an empty and box collider.

If someone could point me in the right direction, that would be great :o)

Thanks for your time!!

Creating gameobjects with nothing but box colliders in them would probably the best way to do it. Mesh colliders are very performance heavy, and the script would be very complicated to make.