Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Child nodes off RigidBody

Discussion in 'Physics' started by kaffiene, Jul 20, 2018.

  1. kaffiene

    kaffiene

    Joined:
    May 26, 2013
    Posts:
    21
    Hi All

    I 'm getting this error (using 2018.2.0f2):

    "Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5.
    If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component."

    What I'm doing is knocking over a tree model. It's laid out like this:

    tree (empty)
    |__ trunk (rigid body, capsule collider)
    |__ Cone meshes for foliage


    I set the rigid body to IsKinematic until such time as I want to apply a force to the tree (knock it over). That works absolutely the way I want it to, visually at least, but I get the error above. I'm not sure why it thinks I want a non-convex collider - does it assume that the code child nodes are part of the collider?
    Is there an issue with me parenting the cone/foliage to the trunk with the rigid body? If this isn't the right way to do this, what is?

    To recap: I'm happy for the physics to just be on the trunk - the foliage intersects the ground when it lands and then I fade it out. But I want the foliage parented to the trunk so it all falls together.

    Any help would be appreciated!

    Peter
     
    Last edited: Jul 21, 2018
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,212
    Yes, of course. Any collider in the same GameObject of a Rigidbody or any of its children will be considered part of the Rigidbody's collider. All these colliders must be either primitive colliders (sphere, box, capsule) or convex mesh-collider.

    The most probable solution is just ticking the "Convex" flag in the cone colliders.
     
  3. kaffiene

    kaffiene

    Joined:
    May 26, 2013
    Posts:
    21
    Thanks for that. I don't want the cones included in the collider - but your post pointed me in the right direction. I hadn't noticed that the cones had colliders on them at all. Removing them gave me the result I was looking for. Thanks for your help! :)
     
    Edy likes this.