Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Mesh collider does not working solid way

Discussion in 'Physics' started by siddharth3322, Feb 12, 2016.

  1. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,042
    For my 3d game, I have tee with mesh collider and golf ball which has sphere collider attached. But my sphere collider goes into mesh collider so not running physics very well.

    Following images demonstrate more idea about my problem.

    meshcolliderbug1.png

    meshcolliderbug2.png
    I want my golf ball not go inside tee mesh collider. Both object has rigidbody attached. tee has kinematic rigidbody. As well for both model, I have set continuous collision detection setting. My unity version is 5.3.1p1.

    Please give me some suggestion to come out of this. Even in this I don't any way I can use basic collider.
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Because the tee is dynamic (has rigidbody), it can only support convex collider (physx limitation). Use compound colliders. See docs.
     
    SpaceEnthusiast likes this.
  3. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,042
    I don't want to move tee at different position. Tee model remain at always same position.
    Just golf ball moves position based on device acceleration.

    I just applied rigidbody to tee model just because of better physics implementation.
    now what you want to say?
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I've told you the solution, if you can't understand it, find someone who does, I cannot explain it clearer.

    Make tee static.
    Remove rigidbody from tee.

    Tee mesh collider suddenly works.
     
  5. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,042
    For this kind of tee model, I don't think so any kind of compound colliders work.
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You really don't understand compound colliders.
     
  7. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,042
    group of basic colliders generate compound colliders. Am I right?
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's right. Just make sure that the parent of all of them has the rigidbody (if it needs to me moved). Do not put rigidbody on each collider.
     
  9. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,042
    Tee already contains kinematic rigidbody so obviously its not movable object. Tee has dynamic shape so creating compound collider is really tough so at present I am only seeing mesh collider is solution for me.
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    2018.3 upgrades the precision and quality of the physics, is that an option for you? it will be out shortly. If not, I can only recommend you make a video of the problem...