Predicting the ball final points

Hi there,

I have a 3d soccer game, I’m passing the ball between the players and shooting the ball to the goal.

My biggest problm is to predict the final points of the ball in case of the user is passing the ball for another player, so I need to know which player to move and were to move to.

Also, I need to predict where the ball will hit the goal post so the goal keeper will know where to jump at. (in this case I don’t need the final points of the ball, in most cases the ball will meet the goal post in approximately mid way).

The movement of the ball is devided to two-

first, the ball position is changed based on the user touch locations, then, a rigidbody with velocity is activated to complete the full ball movement path with landing on floor.


Especially for the goal keeper issue, you could fire a ray in the direction the ball is going (make sur your the ball will ignore raycast by picking the good layer), by putting an invisible plane with a collider in the goal you can have the position of your hit (above the line) and then make your goalkeeper jump :slight_smile: