Search Unity

Books fly off shelves after play

Discussion in 'Physics' started by GearVR, Feb 26, 2018.

  1. GearVR

    GearVR

    Joined:
    Nov 13, 2015
    Posts:
    16
    I have a Blender scene with book shelves with many books modeled as leaning against each other.

    When I play in Unity, the books all bounce off the shelves, probably because the books penetrate each other slightly when the artist modeled them as naturally resting on shelves and each other, and there is a chain reaction of penetration penalty force?

    Other than this behavior, the physics work fine. I don't want to manually adjust the books. What should I do?

    Everything has Rigidbody. I also tried making shelves as kinematic
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    You could manually adjust the colliders to be smaller, so they don't touch anymore. Or at least enough that it doesn't cause the problem.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,443
    some ideas,
    - i'd manually adjust to books, so that trying to fix this in some other ways doesn't cause extra issues later..
    - could disable/remove physics from books, until player picks them up (i guess this is possible since they have physics?)
    - add lots of drag / physic material with high friction and no bounce..
    - adjust physics settings to higher (but probably uses more cpu then..) https://docs.unity3d.com/Manual/class-PhysicsManager.html *looks there is "adaptive force affects the way forces are transmitted through a pile or stack of objects, to give more realistic behaviour" *this would effect all other objects also..
     
  4. GearVR

    GearVR

    Joined:
    Nov 13, 2015
    Posts:
    16
    Thanks for the suggestions, here is what I tried

    add drag like 10^8 and created a default physics material with bounce=0. This is effective and the books mostly stay in place. However, the physics behave like gravity is 0. I suppose I can set the drag back to 0 after interaction has ended with book.

    Adjust physics setting higher didn't stop this behavior. Same with adaptive force.

    I was hoping that large drag allow the books to settle and I then save the books in equilibrium as a prefab. However after setting everything back to drag=0 some books still fly off again. Is this some way around this?