Goalkeeper movement.

I am making a simple soccer penalty shootout game. I am not able to do scripting for goalkeeper. Can anyone help me?

Now i am able to move the goalkeeper but how to reset his position. Whenever goal is scored or if he saves the goal then i want to reset his position to his initial position. Ho to do that?

  • Have a position near the center of
    the D box as the default position for
    the GK.
  • When the ball enter the your half of the field, create a switch between “Opponent Possession” & “Your Possession”.
  • Lets first talk about “Opponent Possession”. Always LookAt the ball. Create a percentage of the ball from you towards the half line.
  • Depending upon this percentage position the GK towards the ball. Also Calculate the percentage of the ball on the width of the pitch. WIth this percentage, position the GK within the width of the GK area.
  • When the ball is less than certain distance from the GK, make a run for the ball.
  • If the ball is less than certain distance (min) from the GK, allow the GK to snatch the ball 8 out of 10 times. (Value of the Player).
  • Considering the case of “Your Possession”, at times when you have to snatch the ball the player actually has to kick the ball.

I hope this helps to start!!!