Search Unity

Bouncing ball that loose speed

Discussion in 'Physics' started by NicoVlhv, Jan 8, 2019.

  1. NicoVlhv

    NicoVlhv

    Joined:
    Aug 3, 2018
    Posts:
    10
    Hi !

    I would like to create a bouncing ball that loose speed each bounce, the round is suppose to end when the ball has no more velocity.

    In order to do that, I applied a physics material and a rigidbody to my ball.
    The physics materials has bouncing property to 0.6 and maximum, and friction property to 0 and minimum.

    I throw my ball with a rigidbody.AddRelativeForce(Vector3, ForceMode.Impulse).

    The problem is that my ball keep going straight even after it stopped bouncing. So it indeed loose vertical velocity (du to physics material parameters), but it still has horizontal velocity.

    What could be a solution ?

    Thanks for your answer.
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,459
    You may add some angular drag to the rigidbody. This should reduce the horizontal velocity as the ball encounters some resistance to rolling.
     
  3. NicoVlhv

    NicoVlhv

    Joined:
    Aug 3, 2018
    Posts:
    10
    Perfect. I added drag and angular drag and it worked perfectly. Can i be explained how do it work ?
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,459
    Sure. Drag is a resistance that opposes movement, like when a ball is moving in the air reduces its speed (as air is a viscous medium). Standard drag opposes the lineal velocity (reduces motion) while angular drag opposes the angular velocity (reduces rotation). Both combined makes the realistic effect of a ball losing velocity as for the surrounding medium.