Search Unity

Object not colliding with mesh

Discussion in 'Editor & General Support' started by yellowlabrador, Jan 13, 2007.

  1. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hi all,

    Just needed some help / suggestion as to how to prevent this kind of thing from happening.

    I got the ragdoll, once in a while it will go thru a mesh(barrel)

    Barrel has a mesh collider and ragdoll was created using the wizard

    I'm thinking of surrounding the barrel with box or capsule collider inside the barrel but not sure if it's the best way to correct the problem.

    or if I duplicate the barrel and reverse the normal of the duplicate and add a mesh collider, Will it work?

    attaching a image to better describe the problem.

    Thanks,
    Ray
     

    Attached Files:

  2. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    Meshes can't collide with meshes in case that might somehow be the problem.

    I find the best way to do cylinders is to use multiple box colliders.
     
  3. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    It could be a few things. The mesh that's showing through may just be outside of any physics collider.

    For instance, part of the face on your previous screenshot isn't covered by the sphere collider for the head:



    If that isn't it you probably will want to have some sort of thickness to the barrels (tubes instead of cylinders).
     
  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Try making the colliders on your ragdoll a wee bit bigger than the actual clown?

    I had a similar issue with portals. You could add a few more primitive colliders to hands feet etc, or have a collision barrel smaller than a mesh renderer barrel, which is all workaroundage...

    Or maybe if you subdivided the mesh on the drum, the extra verts would increase the collision detection and create a better scenario? Im not sure theres a straightforward answer, as I have seen this issue also in AAA commercial videogames
    AC
     
  5. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hi All,

    @ Yoggi
    Adding box colliders inside the barrel resulted the same issue but much better.

    @Matthew

    Adjusted the colliders around the ragdoll and added some for the feet and hands

    @Targos
    Colliders are a bit bigger than the ragdoll body.

    @Matthew
    Yes, some mesh go outside the physics collider especially in the knees when the ragdoll knees bends.

    Even the collider sometimes goes thru the mesh with box collider inside the barrel.

    So far what I did is made the barrel bigger / wider, move the trigger that will cause the ragdoll to be destroyed closer to the rim of the barrel, will be leaving the box colliders inside the barrel for added cushion or padding (not sure what to call it)

    Some screen shots before the barrel size was increased.

    Thanks,
    Ray
     

    Attached Files:

  6. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Ray-Did you try subdividing the mesh for increased collision detection?

    Or (and this is a bit of a long shot)

    Imagine a black texture(floor) with white rings(barrels) on it representing a top down view of your arena. Perhaps you could use the "generate heightmap" script (procedual examples) to create an invisible mesh at runtime? You will need to add a meshcollider via scripting...

    I'll stop trying to offer up ideas now, as I've run out :)

    Hope it goes well. Its funny how lots of us think clowns are stink and want to use them as baddies...
    AC
     
  7. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    What is your physics framerate? are you getting decent performance in the game? Adding a box collider to the barrel didn't work? Does it work with a non-skinned mesh ragdoll?
     
  8. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    @targos
    Tried messing with the mesh but did not make any difference.

    Not ready to use generate heightmap, too lazy to try to learn :) . Will eventually use it later on the mini golf game.

    After dunking this clown, got to whack it later!

    @Yoggy
    Framerate plays between 25 to 91, depends on what's going on during play mode. Have some other effects running during play mode.
    The box collider made it better, but sometimes, depends on how the clown bends, little bit shows up.

    So far so good!

    Thanks for everybody help.
    Ray