Search Unity

model falling part way through floor

Discussion in 'Editor & General Support' started by Colin Holgate, Jan 17, 2007.

  1. Colin Holgate

    Colin Holgate

    Joined:
    Jan 15, 2007
    Posts:
    263
    I have a plane across a large area, and a few primitive boxes initially in the air. I also have a model imported (via FBX format, Y axis up, with meshes have colliders turned on). The floating boxes and the model have rigidbody attached, and using gravity. The plane just has a box collider attached.

    When I play the scene the boxes behave completely correctly (well, maybe the very corners stick through a bit), even bouncing off the imported model if they are close enough, The imported model hits the floor (from a very low height), but instead of just settling there some of the model ends up below the level of the plane.

    If I position the model higher in the air, it can even catch on the floor for a moment, before then passes completely through. If I make the model a lot larger (nearly as big as the entire plane), less of the model sticks through.

    Is there a way to set the effective physics resolution of the plane, so that things can't fall through it?

    Ok, after typing all that I thought of something to try, but I'll leave the above text in here so that someone doing a search might find my answer too. As you all probably knew, placing a cube automoatically includes a box collider, and the tutorial had me make a cube and not a plane when it came to the physics example. It turns out that a box collider on a plane does not work so well, and if you want a plane that acts as a good solid ground you should make a thinned out cube with its box collider instead. Then things behave correctly.

    I wonder if from a physics point of view whether a plane should be thought of as infinity thick instead of infiinitely thin?
     
  2. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    Good question. I think objects passing through each other has to be one of the most-often asked question on these forums.
     
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Most likely your models are at a tiny scale. There are a couple of values in the physics manager which are tweaked for working nicely with objects that are sized around a meter based world where your average crate is like 1 meter big.
    Eg. if your objects are tiny and gravity is set to be 9.81 like on earth. Then your objects will actually fall very fast, in relation to their own size. So if your world is small you probably have to adjust the gravity to match it.

    See use the right size section:
    http://unity3d.com/Documentation/Manual/Physics.html


    You probably also want to to set the "min penetration for penalty" value to something smaller than 0.01.
    http://unity3d.com/Documentation/Components/class-PhysicsManager.html


    However by far the easiest and obviously right solution is to simply make sure you are making all your content at the right size. If you create a cube in unity it is exactly one meter big, you can use that as a reference.
     
  4. Colin Holgate

    Colin Holgate

    Joined:
    Jan 15, 2007
    Posts:
    263
    Thanks for the pointers, I read up on those things. As for my model, it's about 1.3x1x.8 metres, so not tiny. I was going to keep looking, but as you've mentioned size, how do you make a particular sized primitive? Do you assume that the primitive is 1 metre in all dimensions, and then adjust the scale, but read the scale value as metres?
     
  5. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
    The scale is just a multiplier. So 1.5 meters scaled by 3 gives 4.5 meteres. And so on and so forth :)

    d.
     
  6. Colin Holgate

    Colin Holgate

    Joined:
    Jan 15, 2007
    Posts:
    263
    In other words, no, there isn't a set of Size fields!