Check peripheral collisions

Hello everyone,

I’m making a videogame where the user must kick a penalty. I have a problem in the management of collisions between the ball and the pole / crossbar.

Let me explain better, if the ball hits the supercie the entire surface of the pole, unity correctly detect the collision.

If the ball hits only a portion of the post or the crossbar does not happen any collision and passes through.

To solve this problem I thought to use a raycast but if applied to the center of the ball, the peripheral parts of the balloon would not be controllable.

Should I apply 4 raycast for each vertex of the ball? Is there a better solution?

I am attaching a photo to better understand when unity does not verify the collision.

Thank you and good job.

You could try to use a SphereCast which exactly matches your ball.

Think of the sphere cast like a thick
raycast.

More details here.