Search Unity

Box Collider

Discussion in 'Editor & General Support' started by Hazelden, Dec 10, 2006.

  1. Hazelden

    Hazelden

    Joined:
    Dec 10, 2006
    Posts:
    3
    Hi. I am working on making a crokinole game. Crokinole is a game where you shoot discs on a board and they collide with other discs. There is a cylindrical hole in the center of the board where you try and land your disc.



    The board is a mesh collider.

    I have been experimenting with the various colliders available for the disc shape.

    The capsule collider doesn’t have a flat base so the disc wobbles.

    The box collider won’t allow the disc to “land” in the round hole and when two discs collide they don’t rebound correctly with the box collider if they hit on their corners.

    Is there a way to make a cylindrical collider in unity or to have two mesh colliders interact?

    Thanks,

    Andrew
     
  2. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Cool idea.
    My only suggestion is shrinking the box collider so the corners match the disc size? If you can sell the illusion then that should work...

    Or two completely flat sphere colliders, parented to the disc, one on top one on bottom?

    Simple but fun By the looks of it
    AC
     
  3. Hazelden

    Hazelden

    Joined:
    Dec 10, 2006
    Posts:
    3
    Thanks for the suggestions.

    The sphere collider in Unity 1.6 only has a single radius field, so I can't squash it flat vertically and keep it's width and length the size of the disc.

    Andrew
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    You can use compound colliders. Simply create several child objeccts of the rigidbody. Eg. a box and a couple of spheres surrounding it should work pretty well.
     
  5. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Yeah I thought that too. maybe 10 capsule colliders arranged in a disc around the edge of your puck? That means adding 10 emptygame objects and a capsule collider each?
    Now you should be in bussiness
    AC
     
  6. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    I have gotten great cylinders by using multiple boxes aranged like a quadrangular star of david. any number of boxes will work, but more is harder on the phyisics and a better effect. You should be able to get away with at least about 6 colliders per disk.