Announcement

Collapse
No announcement yet.

Help with AI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with AI

    Hello All,

    What would be the best way to have an enemy stay stationary in a certain area, then once the player comes within a certain proximity of that enemy, it will start shooting at the player until the player leaves the proximity, then the enemy will stop shooting? Suggestions?


    Thanks

    #2
    You can override Controller::SeeMonster() and Controller::SeePlayer() in your Bot class to start your attack state. Also in that function, set the Bot's Target, Enemy, and Focus to that enemy. Every so often in the attack state (every half second or so), you should call Pawn.Weapon.CanAttack( Enemy ). That function will check for range to target and other relevant conditions. If CanAttack succeeds, start firing by calling(Pawn.Weapon.BotFire(false)). If it fails, stop firing by calling StopFire().

    Helpful?

    Comment


      #3
      Thanks for the reply. I'll definitely give that a try and let you know how things go. Thanks again.

      Comment

      Working...
      X