Collision grazing edges.

I’m doing what is essentially a breakout clone, and I found one issue that is really annoying me.

If the ball grazes a block at the edge, it counts as a collision and will destroy it, but the ball won’t bounce off it at all.

The obvious solution was to detect the collision’s contact normal and throw the ball in that direction but that had absolutely no effect.

rigidBodyReference.velocity = Vector3.Reflect(rigidBodyReference.velocity.normalized, collision.GetContact(0).normal) * currentSpeed;

Edit:

I guess it’s simply a limitation due to physics inaccuracies, doesn’t matter what I do I can’t seem to correct it.

If there is a collision event, and the physics material has a bounce factor, it means there was a bounce, even if you can’t spot it.

If you want the ball not to break the brick on grazing hits, check the angle between the relative velocity and the normal.

If you want the ball not to break the brick on any weak hit, simply compare the impulse magnitude divided by Time.fixedDeltaTime to some arbitrary cutoff point.