mesh intertia tensor error

Updating a .3ds model seems to have introduced the following error (though the game still runs:

Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor’s mesh shapes!
Error in file: NpActor.cpp at line: 118

Any leads on where I should look to find the cause? (I see in the script docs how to set a tensor via scripting–if there’s not easier fix.)

TIA

Ive had that issue too. Standing by for confirmation:
AC

PhysX calculates the inertia tensor for meshes automatically. Eg. you build a car mesh, if you know attach a rigidbody it will compute the inertia tensor and center of mass for you from that mesh.

A plane or some other shapes have an undefined inertia tensors. It’s impossible to compute the inertia tensor for a plane.

So physx can’t calculate one and will use a default inertia tensor and center of mass at the transform’s position.

The real question is, why are you attaching a mesh collider to a rigidbody?

Thanks. I thought a rigidbody was required for physics interaction, but maybe that’s only for objects that move? The geometry in question is just the static level geometry (kinematic/no gravity), so I’ll try without the rigidbodies. Live and learn!

It’s odd, though, because our levels have had flat plane meshes (floors) for weeks, and this is the first time we’ve seen this error. Maybe there was some stray vert making the floor non-flat and that got fixed or something.

Anyway, for future reference, is the error harmless? A default is being used? The game does run, but I decided not to ignore the red warnings :slight_smile:

The error is harmless. If you are using a kinematic rigidbody it can be ignored completetely. In any case, you shouldnt attach a rigidbody to static meshes which you are not planning to move it around a lot.

The rigidbody docs has a fairly thorough overview when to use rigidbody, kinematic rigidbodies, static colliders or triggers.

Thanks. SOME of thing things I “understand” about Unity are early mistakes I picked up at the very beginning… and since they worked, I haven’t needed to go back and re-learn, which I should do :slight_smile:

And will–starting with rigidbodies…