Search Unity

fill a bottle with pills mesh collider

Discussion in 'Physics' started by solopub, Sep 12, 2020.

  1. solopub

    solopub

    Joined:
    Jul 27, 2020
    Posts:
    1
    3D Game. I have four pills and put in a bottle. I added mesh collider to bottle. Pills can not enter outside of bottle but when ı put in bottle , pills can exit from inside of bottle. Is this a bug ? or how can I fix it?
     
  2. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    467
    If the bottle has a rigidbody it’s considered dynamic. This makes the mesh collider calculate the convex hull of the bottle and makes it a solid, filled object. Remove the rigidbody from the bottle and try again. If it works now that’s the culprit
     
  3. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    Your mesh may not contain back faces. If so, this is something you would need to fix in modeling software, not Unity.