x


mesh collider - alternative mesh

i have a need for extensive use of mesh colliders in my game, i noticed significant drop in frame rate though. when using box, sphere or capsule colliders everything is fine, but they are not accurate. i can replace some of the mess colliders with primitive ones where i can but some definitely require mesh colliders, so my question is can i use alternative mesh collider? alternative mesh would be low poly of the high poly model that will be in the scene. is that possible?

if not what would you people propose?

more ▼

asked Jun 17 '10 at 04:19 PM

pretender gravatar image

pretender
497 121 134 145

Another alternative that would be more efficient would be to build a more detailed collision volume out of primitives likes boxes and spheres.

Jun 17 '10 at 05:25 PM Seth Illgard

can i ask for the reference how to do that?

Jun 17 '10 at 10:55 PM pretender
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Yes that's possible. In the mesh collider component you can choose any mesh in your assets to be used as the collider mesh.

more ▼

answered Jun 17 '10 at 04:44 PM

StephanK gravatar image

StephanK
6k 39 53 93

is that going to be faster?

Jun 17 '10 at 10:54 PM pretender

The smaller the mesh the faster the calculations... ;)

Jun 18 '10 at 07:56 AM StephanK

how to do it if i may ask?

Jun 18 '10 at 12:22 PM pretender

make the lowpoly mesh a child of the highpoly mesh, make sure they're at the same position. then all you have to do is turn the mesh render off at the lowpoly mesh so you can't see it, the collision will still work.

Sep 13 '11 at 03:23 PM LeeGibson

You don't need a child game object. The mesh collider component has its own mesh property that can be set to a different mesh than the one being rendered.

Sep 20 '11 at 01:03 PM amirabiri
(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:

x1682
x1352
x55
x14
x12

asked: Jun 17 '10 at 04:19 PM

Seen: 2274 times

Last Updated: Sep 20 '11 at 01:03 PM