GIL,

How does Move AI detect it has reached a waypoint and when to cycle to the next waypoint?

I have a combatant spawner that is assigning waypoints to the spawned combatant. However, the combatant is going to the first waypoint and not progressing to the next waypoint's target position according to the Movement AI Component info. My set up is using a RichAI component from Astar with a reworked version of your AIPath Movement Component Setting plugin. The RichAI detects it has reached the correct location but the Movement AI Component doesn't recognize it. I have the stop distance increased to 1 in the Move AI to see if that helped, rebuilt the nav mesh, and tried enable/disabling idle settings in the Move AI but no luck so far. Is there a way to send notification of reaching the target location?

Here are my spawner and move AI set ups https://imgur.com/iy58EEz

thanks
  • edited January 17
    The move AI does a simple distance check between combatant and waypoint position, checking if it's below/equal the defined stop distance.
    Once the waypoint is reached, the optional idle schematics kick in and do something, afterwards (or immediately when not used) the next waypoint is selected and movement starts, notifying the movement component.

    Is your movement component moving the combatant to the position or does it stop some way before the waypoint? You can check that by pausing the game and checking the two positions (combatant and waypoint) in the editor.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The combatant visually moves all the way to the first waypoint before getting stuck. The transform position is correct with slight variation (<0.1) of Y axis but I have the stop distance set to 10 to compensate assuming that doesn't apply only to horizontal plane.

    Last night I was comparing to a scene that the MoveAI is working correctly in and I did realize the MoveAIComponents on all the AI controlled combatants in the problematic scene are reporting Can Use as false. I am about to dig through using breakpoints to see if I can figure out why.
  • edited January 18
    Tracked it down to a Move AI Range that was set in the general Battle settings. It was returning false for ORK.Battle.CanUseMoveAI(this.combatant) in the MoveAIComponent's CanUse() method as the assigned waypoint was further away then the range.
    Post edited by shortyyard on
  • Beside that general move AI range, each battle system can optionally use a custom range if you want (and you can also turn off limiting it to range).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.