How to animate level mesh with collider?

I’ve created a model in Blender that contains a single object with an Armature associated. The Armature contains separate bones for each loose collection of vertices in my object, with vertex groups assigned to each bone. I then created an animation of panels opening and a ramp extending.

38168-ramp.gif

I’ve been importing my .blend files into Unity and generating mesh colliders for the basic level geometry. My understanding is that Unity drops the mesh collider generation when animations are imported because you can’t animate a mesh collider. I can settle for using primitive colliders, but I’m kind of clueless as to where to go from here.

  1. How would I go about animating the ramp with associated primitive mesh colliders? Any good resources for Unity level (not character) animation?
  2. Should I not be animating the model within Blender if I can be doing it in Unity? Is it easier to just handle everything within the same system?
  3. If I’m going to stick with Blender for animating, I’m not really clear on how to set up multiple animations (with proper naming). Also, is it ‘correct’ to keep things the way I have it, as one object, or should it be broken up as one object per separate piece?

Well, I believe I’ve figured it out.

I decided to go with Mecanim after all, and not import animations from Blender. I did leave the Armature in place, but applied no animations to it prior to importing.

I created 4 animation states within an animation controller: Ramp Open, Ramp Closed, Opening, and Closing. Each corresponded to an animation loop (two of which were just single frames of the open/closed position). I then set up logic to transition between the states depending on a boolean value (triggered) or through completion of the opening/closing state.

As I anticipated, adding the box colliders was much easier once I imported the model with each bone at nice, flat angles. So the ramp, which previously was imported at the open state, was imported at the closed state where it’s flat. The collider, when applied to that particular piece of the armature, would then follow along with the object throughout its animation phases.