Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Model disappears when applying a RigidBody?

Discussion in 'Editor & General Support' started by klindeman, Aug 17, 2005.

  1. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    I have imported my tank model (an FBX export out of I think 3DSMax). I add it into my scene, it has a MeshCollider and everything. Once I add a rigid body to it and hit the play button, it completely disappears. When I hit play again to stop it, in the editor parts of the tank are missing. I have another FBX export of a Truck that works fine.

    Any ideas on what is causing this? I am going to see if I can get the modeler to export the tank again.

    I have attached the tank...
     

    Attached Files:

  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Don't add mesh colliders to rigid bodies.
     
  3. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    Er.

    For my Truck, in my import settings, I hit "Meshes have colliders"

    Then I added a rigidbody to it.

    It correctly works, and will have gravity all that, move along my level and collide with it like it should.

    When I turn off "Meshes have colliders", it doesn't collide with my level at all, making it unusable.

    Am I missing something important here?

    Oh, and also, I am not adding the rigidbody directly to the Model itself, it is a child of an empty object which has the rigidbody. I did that so it didn't lose its prefab abilities.
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The idea is that you add primitive colliders to rigid bodies.

    Mesh-mesh collision detection is a) slow b) not very solid.

    Thus use mesh colliders for level geometry and primitive colliders (sphere, box, capsule) for rigid bodies.
     
  5. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    Ok. I will try that.

    I think I vaguely remember hearing that already somewhere.
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Yeah in the docs.
    :)
     
  7. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    Silence!
     
  8. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    And yes, that did fix it. That was weird. Some sorta hack you guys got in there when I try to add in a RigidBody and a Mesh Collider, to have stuff disappear on me? :p
     
  9. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    I was taking a look at it and it turned out to be a bug in the inertia tensor calculation.
     
  10. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    Joachim Ante you rock! I want you to have my first born! :wink: j/k
     
  11. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Hi Joachim,

    wow this would be very dissapointing if i understand it right, that you can't apply mesh-colliders to objects and let them play with each other.

    What if i wanna have gears which should move with each other. That would be impossible or i would have to split up the objects which would make no sense from the amount of work.

    And sometimes you do have situations where you just want a few large objects look very right, And there is no mesh-colliding between such objects? Even not a convex generated mesh around the object?

    I hope i got this misunderstood?!


    Greetings,

    taumel
     
  12. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    I will be adding convex mesh support.

    Mesh-Mesh collision does not work 100% accurately and is not very fast so i can't really recommend it but if you need it for one particular case, you can use it and it will most likely work.
     
  13. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Hi Joachim,

    but will you also work on implementing/improving concave objects so that it's fast and stable? Is this a problem due to implementation or is it a problem because it's not working properly in novodex?

    Concave objects like gears which interact with each other are really no magic and without such a robust mechanism there would be a lot of simple-medium game ideas out of the game. Also one of mine...

    This is even possible in old directors havok and works if you restrict yourself not going too far. And don't we have this killerphysics engine novodex now?


    Greetings,

    taumel