Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Billiard balls behave unrealistically upon break.

Discussion in 'Physics' started by Haseeb_BSAA, Jan 19, 2022.

  1. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    So, I have this problem, even when I apply a small amount of force, the balls seem to get pushed away easily. Here's how they should behave (GIF from 8 ball pool game):



    And here's how I have it :



    Rigidbody of balls:



    Physics Material of Balls:



    Physics Material of Table:



    Project Settings:



    I tried playing with static friction values for the balls and table, but it doesn't seem to give me realistic results either. Does anyone know what should I do?
    Increasing mass doesn't have an effect, I tried it. What seems to have an effect is the drag. Though increasing drag doesn't really produce realistic results, it makes the balls a lot more firm, but then again, increasing drag makes the ball seem like pieces of rough wood.

    Note : No script is changing the behaviour of the balls either.
     
  2. AlTheSlacker

    AlTheSlacker

    Joined:
    Jun 12, 2017
    Posts:
    326
    Reduce the Bounciness value of the ball material. You may also need to increase the physics solver iterations to keep multiple, successive contacts stable. Use appropriate masses and inertias.

    I think the lack of a pressure wave through touching balls will limit your ability to copy this perfectly using PhysX, but I may be wrong.
     
    Last edited: Jan 19, 2022
    Haseeb_BSAA likes this.
  3. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    Tried all of those things, nothing seems to make it work. Increasing drag is the only thing that kind of makes the balls more firm, but then they feel like pieces of rough wood (and still not realistic results). And by inertia, do you mean drag? Haven't seen that option yet.
    Also, I feel like it's the technical limitation of PhysX too, if I was to write my own system, would I have to completely stop using Rigidbodies, or can I still use Rigidbodies but make changes to their behaviour? Thanks.
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,430
    I don't think PhysX could simulate this properly, at least in the way it's setup within Unity. Collisions rely on rigidbody contacts and penetration. Static contacting balls won't transmit their energy realistically as expected in a billiard game.
     
    Haseeb_BSAA likes this.
  5. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    I've seen several people say the same thing, and I guess it's true that it's the limitation of PhysX engine. However, if I was to overcome this issue, how would I go around doing that? Can you give me some general advice on how to get started? Would I need to make changes via scripts to the behaviour of the rigidbodies of the balls, or would I need to stop using rigidbodies altogether?
     
  6. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,430
    Personally, for realistic results I wouldn't use Rigidbodies at all. Assuming no balls jumping, it would be a 2D simulation using circles and lines. I don't know how to develop this kind of simulation, but these are some topics I'd start looking at:
    • Continuous collision between balls and solid edges, with proper bouncing.
    • Transmitting momentum between static contacting balls.
    • Angular momentum in contacts and bouncing.
     
    Haseeb_BSAA likes this.