0
\$\begingroup\$

I have in my Unity3d Project a capsule that represents a character and has a Rigidbody and capsule collider as components, and in my project I also have a mesh that is my terrain imported as fbx from blender. I put a mesh collider to the terrain but the capsule goes trough the terrain as it had no colliders. Curiously, if I put a cube with a mesh or box collider, the cube does collide properly. Changing the Is Convex box in the mesh collider doesn't change anything Any ideas?

EDIT
This is how the editor window for both, the capsule and terrain looks like: Terrain Terrain Capsule Capsule

\$\endgroup\$
  • \$\begingroup\$ How are you moving your capsule collider? \$\endgroup\$ – DMGregory Mar 6 at 12:40
  • \$\begingroup\$ I'm not moving the capsule collider, I just put it over the terrain let it falling down to the terrain to see if it collides, but it passes trough it. \$\endgroup\$ – Sebastián García Mar 6 at 12:43
  • \$\begingroup\$ Can you show us the inspectors for both the terrain mesh and the capsule, so we can see all the details of how they're configured? \$\endgroup\$ – DMGregory Mar 6 at 12:44
  • \$\begingroup\$ @DMGregory Ok, edited \$\endgroup\$ – Sebastián García Mar 6 at 12:48
  • \$\begingroup\$ 1) Your terrain isn't convex, so don't check the convex box. 2) Do you see different behaviour if you put the MeshCollider on the same GameObject as the terrain's MeshFilter? 3) I see you have an Animator and a MoveScript on the capsule. Does removing those change the behaviour? If so, can you show us what they're doing? \$\endgroup\$ – DMGregory Mar 6 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.