Search Unity

AI Player predicts movement on ball velocity

Discussion in 'Physics' started by gregmax17, Nov 7, 2015.

  1. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    I'm having a hard time trying to figure out how to get my AI player to get into position when the ball is kicked.

    Lets say the ball is kicked to the AI player's right side in front of him. If the ball was kicked with a slow enough velocity the AI player should know that it can get behind the ball and let it roll to him, or charge the ball after it gets aligned with it. But if the ball was kicked with enough velocity, the AI player knows it can't get behind the ball and needs to know where to run to meet the ball and stop it before it keeps rolling away.

    I'm using air drag, ground friction, and gravity for the ball physics, while the AI player has a constant velocity.

    I wouldn't appreciate any math and examples on how to do this, the more example scripts I see the better I understand.