Getting realistic bounces using physics materials.

Hi,

Im trying to set up am object spawning gun to fire spheres that will then bounce off all the walls accurately.

Unfortunately, if the angle is any more mild than about 70 degrees, the ball just slides along the wall that it has collided with.

The settings of the wall and projectiles physics material are...

-- Bounce on 1 all frictions on 0.#

-- 1 mass, 0 drag and no gravity or Kine.

Can anyone please suggest a solution, or alternative.

Thanks, - Graeme.

EDIT: Additional info.

" I should probably mention though that I'm trying to simulate ball physics like these - tanktrouble.com - I think the problem is that when the angle gets to low, the physics think it should roll across the surface instead of bouncing away at the correct angle. so what I really need is a solution to get my ball physics down to pure bounce, for total reflection of the initial angle - Any suggestions please? Thanks "

All frictions are too low, that's probably your problem right there. It's a pretty common question people ask, wondering why their ball slides instead of rolls. :)

Set your dynamic frictions to 1 and see how that affects things. Go down from there if you need it to not be 1.

Because this comes up in searches for example Physics Materials, here are the original Bouncy, Ice, MaxFriction, Metal, Rubber, Wood, and ZeroFriction from Unity:

http://exninja.com/files/PhysicsMaterials_From_Standard_Assets.unitypackage

Pool balls have a very high elasticity, so you should set your bounciness at close to 1. They also have very low Friction, so both static and dynamic should be set at close to 0.

I’m less certain about pool tables however. They probably have pretty low friction and bounciness, both around the range of 0.1-0.3 if I were to guess.

I was struggling with the same issue when I have started working on a Pool game. Tried every possible combination of bounciness, friction, mass, drag but nothing had solved this issue. It was so frustrating that I had nearly dropped the idea of this. But then I found some pointers on other forums and that led to solve this issue.


So basically it was a setting for Physics2D. Go to Player Settings >> Physics2D. Look for Velocity Threshold property. By default it is 1. That means if your ball’s velocity drops below this value then Unity Physics engine will consider both surfaces as non-elastic or no bounciness. When your balls keep colliding to edges or other balls, it gradually looses its energy and velocity. As soon as the velocity drops below 1, it looses its bounciness and just keep rolling along the surface. Reducing this threshold will fix the issue. But be careful, reducing it too low may introduces some jitters. So try experimenting with different values and find which suits you most.


In my case I have set Velocity Threshold to .2. My balls has physics materials with values - Friction = 0, and Bounciness = .7. The Rigidbody collider has mass = 1 and Linear Drag = .5. These values achieved me near to real pool balls colliding scenario.
Thanks.