Adding gravity and physics to runtime imported CAD files.

First, it depends on what actor class the model is imported as. I’m going to assume it’s a “static mesh” actor. (If it’s an instanced static mesh, or hierarchical static mesh, this won’t work.)

Now, for physics to work, two things need to be true:

  1. The physics simulation needs to be turned on (this gives the object “mass” and lets it simulate forces and torques.)
  2. There needs to be some kind of collision geometry, which lets the physics engine stop things that move into other things.

You can easily turn on “simulate physics” on a static mesh actor, by rolling out the actor properties and checking a checkbox.

Collision is a little harder. Physics simulation works best when the bits that can actually bump into each other aren’t too complex – an intricate surface with lots of holes and concave areas, will be extremely inefficient to simulate.

Thus, you will want to open up your static mesh, and add “simplified collision” – some set of collider boxes, spheres, and convex hulls that, when taken together, approximate the shape of the object. (If you play games, this is the “hitboxes” that you’ll find on characters.)

So, open up your static mesh Asset (not the actor) and add some collision – simplified DOP or Automatic Convex Collision might work as a first iteration.

image

Then make the mobility of your Static Mesh Actor “Movable”

Then turn on physics simulation:

image

I find that you’ll want a little bit of angular momentum dampening, to make simulation be robust and not explode into infinity. The default is 0 which is not enough.

If your object is big and complex, then you might want to separate it into several less complex objects, or at least be a little more deliberate in placing collision boxes to align with the various internal/external surfaces of the object.
(There’s also a way to build proxy shapes in DCC tools like Blender or Maya that will be imported as simplified collision shapes; I don’t know of the CAD import can do the same thing – chancer are, probably not.)