Search Unity

Roulette Using Physics - Colliders

Discussion in 'Physics' started by NickSP, Feb 4, 2015.

  1. NickSP

    NickSP

    Joined:
    Feb 4, 2015
    Posts:
    2
    Hello to you all!
    I 'm facing a kind of peculiar problem which I really can't say if it is my problem or Unity's ... I 'm trying to fix a Roulette through physics.. My roulette has a stationary part and a moving part. I've also a small ball (sphere).

    I've placed on both, the moving part and the stationary part, a rigidbody (kinematic & uses gravity) and a Mesh Collider. My ball is GameObject with a rigidbody and a sphere collider.

    when my sphere's scaling is X:0.04, Y:0.04, Z:0.04 the collisions do take place and the ball lies on the roulette. But when I change the scaling of the ball (where I want it to be: x: 0.01 y:0.01 z:0.01) the ball falls through the roulette and through the table!!!

    Am I missing something?? Has anyone any idea why this happens?

    Thanks in advance, kind regards!
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Hi, welcome to the forum!

    One possible problem is that your ball is so small that it passes right through the collider for the roulette wheel between physics updates and so Unity can't tell that a collision has taken place. The first/easiest thing to try is setting the rigidbody's Collision Detection property to Continuous Dynamic. This mode interpolates the path of an object between physics updates to help detect if it passed through a collider. Also, try reducing the Minimum Penetration for Penalty value in the Physics Settings (the default value might be too large to give the accuracy you need with such a small ball).

    Finally, if the roulette wheel is a mesh collider with a single surface then try remodelling it slightly so that it encloses a volume rather than just consisting of a thin "skin"; this gives the physics engine more information to work with.
     
  3. NickSP

    NickSP

    Joined:
    Feb 4, 2015
    Posts:
    2
    Hi Andeeeee, thank you for your worm welcome, and your fast reply!

    Reducing the "Min.Penetration for Penalty" sims to have solved my problem!

    Thanks again! You're a life saver!!