- Home /
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?
Another alternative that would be more efficient would be to build a more detailed collision volume out of primitives likes boxes and spheres.
Answer by StephanK · Jun 17, 2010 at 04:44 PM
Yes that's possible. In the mesh collider component you can choose any mesh in your assets to be used as the collider mesh.
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.
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.