Search Unity

eratic bounces from no where

Discussion in 'Physics' started by EliJNemer, Dec 4, 2019.

  1. EliJNemer

    EliJNemer

    Joined:
    Aug 3, 2019
    Posts:
    88
    hello i am currently trying to make a billiard game, i am having these anomalies in which sometimes when a ball bounces it bounces like 3 times more, or it may just be sitting there and suddenly jump up or be shot quickly on the table with the player doing nothing..

    it is not too big an issue since i can fix it with some tweaking but i would like to know why this happens..

    here is a video of it:

     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,587
    This might be related with the case of two colliders inter-penetrating beyond some threshold. In such cases the physics system may apply arbitrary velocities in order to de-penetrate those bodies.

    You may try setting a low value to maxDepenetrationVelocity in the Rigidbodies. This way the bouncing properties should be more driven by the physics materials and less by the inter-penetrating colliders.

    https://docs.unity3d.com/ScriptReference/Rigidbody-maxDepenetrationVelocity.html
     
    EliJNemer likes this.
  3. Griz

    Griz

    Joined:
    Aug 27, 2013
    Posts:
    115
    Rigidbodies being too small might also be the cause. Making colliders bigger fixes weird rotation and bouncing behaviour. You can also try raising velocity/position iterations in the physics settings.
     
    EliJNemer likes this.