Search Unity

MeshCollider for generated mesh collision only detected on sides, top, bottom. Bug?

Discussion in 'Physics' started by Crayz, Feb 13, 2019.

  1. Crayz

    Crayz

    Joined:
    Mar 17, 2014
    Posts:
    193


    This is loaded from a bsp map file at runtime. If I set the MeshCollider to convex it works as expected, but when set to concave collision occurs only on the sides/bottom/top, never when the other collider is fully inside the mesh. What could be causing this?

    Unity version 2018.3.5f1

    Edit:. The other collider I am testing with is a simple box collider with a non kinematic rigidbody attached. Using OnCollisionStay , it only fires when the boxcollider is touching a side


    edit2: After some reading this seems to be the expected behavior. These collision meshes can come in any shape and size, and I need to be able to detect when a collder is fully inside them. The only solution I can think of is to break it up into a compound collider via code
     
    Last edited: Feb 13, 2019