|
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?
(comments are locked)
|
|
Yes that's possible. In the mesh collider component you can choose any mesh in your assets to be used as the collider mesh. 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)
|

Another alternative that would be more efficient would be to build a more detailed collision volume out of primitives likes boxes and spheres.
can i ask for the reference how to do that?