Search Unity

Precision with Hinge and Fixed joints

Discussion in 'Editor & General Support' started by scrobby4, Jun 8, 2010.

  1. scrobby4

    scrobby4

    Joined:
    Sep 3, 2009
    Posts:
    9
    Hi, all,

    I am trying to create a simple box model using cube primitives for the sides bottom and top flaps. I am attaching the sides to the box bottom using fixed joints and the flaps to the sides using hinge joints. I am also trying to keep the box in its real dimensions (smaller than 1 meter).
    The problems I am running into is that the walls do not actually stay together very well when I drag the box. The joints seem to act much like springs though I think they should be fixed. I have attached the demo code here where the box can be grabbed using the default dragRigidBody script (Escape key exits the application).
    I am starting to think this is a precision problem from the physics engine, but could not find any setting to tweak and correct.
    Any ideas on how to keep the box together when dragged?
    Thanks.
     

    Attached Files:

  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    I think you're probably right about it being a precision problem. I've tried the obvious changes to the physics settings (menu: Edit > Project Settings > Physics), but the box stretches somewhat even with extreme settings. Is it possible to make the game at a larger scale?
     
  3. scrobby4

    scrobby4

    Joined:
    Sep 3, 2009
    Posts:
    9
    Hi, Andee,

    Thanks for the reply. Actually, I have tried that too. anyway, I tried another solution too. I have removed all fixed joints and made a group consisting of the box without the flaps to be the rigidbody. Then, I added the flaps. That was the best solution I found.
    In the end I have decided to keep the box as a kineatic object on the table. For the application we are running, making the box move is not really necessary.
    Once again, thanks for the reply.