- Home /
Why when I even add mesh collider , objects fall down?
I made an ant on blender and export it to fbx and I have all the mesh and stuff. When I added it to the game and added rigidbody it falls through objects instead of standing on them , why?
Did you also generate colliders on the import settings and apply it? or add a collider component to the gameobject?
Answer by barbe63 · Jun 13, 2015 at 09:57 PM
In general speaking mesh collidders are bad to use for many reasons. One of those is when having convex forms, it won't collide. Use primitives colliders (you can make a compound of colliders if you need putting them as childs) to do the job of all your objects. A capsule or a box should be good for your ant.
Another reasons why to never use mesh colliders:
They bring heavy calculation
Mesh colliders won't work with mesh colliders (at least from my experience)
They also act bad with raycasts
Answer by Patrick Lindberg · Jun 14, 2015 at 07:23 AM
Hi! So your ant which has the rigidbody component uses a mesh collider.
There are many ways to solve this, depenging on what you're trying to create. Often people use just primitive colliders. If it is important that the GameObject collides with things detailedly, you can use several primitive colliders.
Then the part of the answer which probably is not helpful :-):
If you still want to use a mesh collider, there might be some other ways than the rigidbody component to create the gravitation. These methods relate with scripting. But I'm not sure... Maybe a transform.Translate(Vector3.down * speed * Time.deltaTime)
which pulls your ant towards the ground... And then when the ant e.g. jumps, the speed variable is decreased or something......
I hope that this helps... :-)