Search Unity

Error:Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5? So?

Discussion in 'Physics' started by blackgun, Aug 17, 2019.

  1. blackgun

    blackgun

    Joined:
    May 27, 2014
    Posts:
    9
    Trying to pick up Unity for the next project, I created 2 gears to simulate the gear interlock motion with backlash.

    upload_2019-8-17_0-32-41.png

    but the test has a problem. non-conex collider can't display as the green mesh, the gears don't collide, as the gears pass through each other.

    upload_2019-8-17_0-9-47.png
    upload_2019-8-17_0-9-35.png

    convex collider can run without error, but it can't satisfy my need.

    BTW, some other thought:
    1. I find the Unity physics APIs are very different to the PhysX APIs although its backed by PhysX, missing many features, I am a bit disappointed after 10 years or I missed something?
    2. A poor doc about physics and very outdated tutorial https://learn.unity.com/tutorial/3d-physics# created in 2013.

    For many Unity developers who stick with this engine, maybe it's not a problem, but my experience can't give it a decent score after spending 2 days to google for doc, tutorial, and sample, but still can't get it working with such "matured" engine. In my previous project, I built the gears simulation demo for a robot application with ODE + OpenGL in 2 days from scratch in 2005.

    Env:
    Unity: v2019.1.12f1
    MacOS 10.14.6
     
  2. kqmdjc8

    kqmdjc8

    Joined:
    Jan 3, 2019
    Posts:
    86
  3. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    1,857
    if you need a concave dynamic object you should make a "compound" collider.

    for the gear example you can have a cylinder collider (don't think there's a primitive cylinder collider, maybe the capsule can be of use, but you can make a convex-mesh collider with this shape) and a separate triangle/wedge collider for each one of it's teeth (again, no build in primitive with this shape, make a convex-mesh collider).

    just parent it all up so that each gear the center is the parent and each tooth is a child of it and it should work.
     
  4. blackgun

    blackgun

    Joined:
    May 27, 2014
    Posts:
    9
    Thanks, but it seems very unstable and outdated.

    Right, it's a solution. Cheers.
     
    SparrowsNest likes this.
  5. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    1,857
    Lemme know how that turns out for you.