- Home /
updateMassFromShapes error
Help I have this error:
Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes! Please change mesh geometry or supply a tensor manually!
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
extra_spawner:spawn() (at Assets/PongScripts/extra_spawner.js:40)
here is line 40:
Instantiate(coins_x2_prefab, pos, rot);
Any idea on how to fix this?
Answer by Eric5h5 · Jan 24, 2013 at 09:18 PM
Don't use mesh colliders for rigidbodies. Use primitive colliders ideally, or if that's impossible then use a convex mesh collider.
That worked! $$anonymous$$ind of, not exactly what you said. I found out I had for some reason a mesh collider in the plane. Thanks for helping me find that. When I removed it, it worked.
Answer by XienDev · Jan 24, 2013 at 07:08 PM
Notes on meshes:
Be sure that you define face normals as facing in the direction you intend. Collision detection will only work correctly between shapes approaching the mesh from the outside, i.e., from the direction in which the face normals point.
Do not duplicate identical vertices. If two triangles are sharing a vertex, this vertex should only occur once in the vertex list, and both triangles should index it in the index list. If you create two copies of the vertex, the collision detection code won't know that it is actually the same vertex, which leads to decreased performance and unreliable results.
Avoid t-joints and non-manifold edges for the same reason. NOTE: A t-joint is a triangle vertex that is placed right on top of another triangle's edge, but this second triangle is not split into two triangles at the vertex. A non-manifold edge is an edge (a pair of vertices) that is referenced by more than two triangles.
When a mesh is being cooked, its mass and inertia tensor is also computed. The inertia tensor computation uses triangles winding to tell which side of a triangle is solid. For this reason, improper winding may lead to a negative mass. An open mesh will probably give an errant mass, center of mass, and inertia tensor result.
It is possible to assign a different material to each triangle in a mesh. See the Materials section for details.
Sounds quite complicated. All the coins_x2 is, is two balls and a plate. The plate is for look, the 1st ball is for bouncing and the 2nd ball is for detecting. Here is the coins_x2 prefab with the scripts it uses: http://www.mediafire.com/?vtq5mje4k4z3z0f
Your answer
Follow this Question
Related Questions
Start() of Instantiated Prefabs Not Being Carried Out? 1 Answer
Error[Component CircleCollider2D could not be loaded when loading game object] 0 Answers
Instantiate Prefabs. Errors. 2 Answers
Instantiating object from inventory 0 Answers
Setting the parent of a transform which resides in a prefab error 1 Answer