x


Using your own mesh for collision?

I have made my own mesh in an external 3d application and a physics mesh to go along with it, but how can I use that phys mesh in unity? Mesh Collider thingy seems to generate it's own model instead of using mine.

more ▼

asked Jan 31 '11 at 07:33 PM

Johan 4 gravatar image

Johan 4
427 81 84 97

(comments are locked)
10|3000 characters needed characters left

2 answers: sort newest

Hi, try this:

Enter in the model you got on the hierarchy panel and add a Mesh Collider to the model not to the root and if you got a collider on the root eliminate it, this way you can use your own mesh for collision, but one thing, mesh collider with mesh collider don't generate any collision.

Your object hierarchy must be like this on the hierarchy view: 3D Object Name > Bones, Mesh 1, Mesh 2, etc.

more ▼

answered Jan 31 '11 at 07:46 PM

3DMagicVR gravatar image

3DMagicVR
152 2 2 11

(comments are locked)
10|3000 characters needed characters left

The mesh collider can be used in 2 ways:

1 - non-convex: in this case, it will use your mesh to generate collisions, the problem is that you can't do collisions between non-convex colliders.

2 - convex: in this case, it will generate a collider that will interage with others convex mesh colliders, but, the mesh can't be more than 255 triangles and will not cover your mesh at all, instead, it will create a convex form of your mesh. Just active this options and see in the scene viewer, it will change the collor to green.

See the documentation:
http://unity3d.com/support/documentation/Components/class-MeshCollider.html

more ▼

answered Jan 31 '11 at 07:52 PM

Borgo gravatar image

Borgo
998 9 13 25

So it's not possible to have custom collision on an object that will actually move? That sucks badly.

Jan 31 '11 at 10:35 PM Johan 4

@Johan: If you're referring to the convexity limitation, then that's fairly standard (collision detection and resolution between multiple arbitrary non-convex objects is highly non-trivial). If you mean something else though, perhaps you could clarify.

Jan 31 '11 at 10:57 PM Jesse Anders

the mesh collision slow down too much performance. Even best cars simulation games uses basic colliders, you can create a variety of colliders and group then to make a "custom collider".

Feb 01 '11 at 12:14 PM Borgo
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2499
x1879
x1364

asked: Jan 31 '11 at 07:33 PM

Seen: 2720 times

Last Updated: Jan 31 '11 at 07:33 PM