- Home /
How do i prevent an imported Mesh from falling through Terrain?
I created a pig in 3DS max and exported it as a .3ds file. I then imported it to Unity and brought into my scene from the assets menu.
Everything was going smoothly(for once) and I applied a rigid body to the mesh as a whole. Whenever i press play it falls through the terrain. I have Generate colliders toggled 'ON' and have tried applying primitives to all parts of the mesh, and using a standard mesh collider. Nothing seems to work. I'm very new to Unity, having less than 2 hours of experience with the software. I'm not using the pro version or any extra features.
Can anyone explain in depth how I can fix this? Please be as specific as possible when answering as I am very, VERY new with Unity.
Thanks in advance.
Check that your pig is actually above the ground, try raising it way above and verify it falls down and then through.
Does the floor or terrian have a colider on it? if the pig does but the floor does not then the pig will fall right through the floor or terrain because the collider will not sense a collision with the floor.
Answer by duclaw · Aug 20, 2013 at 08:24 AM
set you mesh collider to convex, you will see it in the inspector panel by the right-hand side and also check if one of the components(rigidbody, collider or terrain) is set to isTrigger, it is also in the panel
I've tried all these suggestions and still no luck. Anyone else have any ideas?
Answer by aldonaletto · Aug 21, 2013 at 03:21 AM
As @duclaw said, a mesh collider must have Convex set, or it will fall through the Unity terrain. If you still have problems with your mesh, use a sphere, capsule or box collider instead: select the pig and click menu Component/Physics/Box Collider (or Sphere, or Capsule), then answer Replace to the question "Replace existing component?".
Answer by superluigi · Aug 21, 2013 at 03:24 AM
If you could add a picture of the inspector when you click on your model it would help greatly. These are just 2 of the possible solutions. In the inspector, right next to the colliders name there is a check box. Make sure its on. Now the first option on collider is "Is Trigger". If "Is Trigger" is on then it will ignore collisions so it would cause your collider to fall through the floor. In other words you want "Is Trigger" set to false.
Your answer
Follow this Question
Related Questions
Colliding with trees using mesh colliders 1 Answer
Returning list of Triangles, Vertices or Points by raycasting through a mesh (iPhone) 1 Answer
Mesh Collider Bounciness working only in a few areas 1 Answer
Collision Colliders - Box or Mesh for Terrain 1 Answer
3rd Person Physics not working? 1 Answer