making ball ricochet at wall

I’m trying to create a billiards game, so I need to reproduce the ricochet of the ball when it hits the wall.

3361392--263258--pool.jpg

I already tried to create new physic material and set its bounciness to 1 and played with its properties but no success. Also I don’t intend to use something like Vector3.Reflect in OnCollisionEnter because I think it would kill the real physics (that just don’t have these perfect reflections). What happens now: the ball hits the wall and stops.

In a nutshell, I want to know how to make the ball ricochet correctly when it hits the wall.

Can you show what your sphere looks like in the inspector?

This seems to work fine for me. I created a new sphere, added a rigidbody, and set its Collider’s Material to a new Physic Material with a Bounciness of “1”. Then I add force to the sphere (rb.AddForce( new Vector3( 100, 0, 44 ) * 10 );) and it bounces just like I’d expect a billiard ball to bounce. So, this should work. Let’s see what you’ve got?

If your looking for a more math approached answer you can use the dot product to get the direction of the face and reflect the angle off the cross product.

This page explains it nicely although written in lua it should get the point across.