Help with "make ball fall in hole" code

Miscellaneous Forums/General Discussion/Help with "make ball fall in hole" code

Yeah.

If the Ball's centre is within the hole's radius then rotate the ball's vector towards the vector from ball centre to hole centre.

The rate/amount you rotate the vector by is based on the distance from ball centre to hole centre. Something like:

ball_delta_angle = angle_from_ball_vec_to_hole_vec * ((hole_radius - ball_to_hole_distance) / hole_radius)

This is just off the top of my head so...

I think if things are done right, this should allow the ball to ride around the rim and even 'escape the hole's gravity' and miss, if the ball has sufficient velocity and/or trajectory angle.