I am trying to setup an AI that moves (and hunts enemies) only within a certain range of the spawn position.

In the Move AI I set up in a
Base Settings a Move Range = 4 and
Hunting Settings Hunting Range = 4
but the AI does not continue wandering around (as it does if those 2 options are disabled) within that range and doesn't chase the player if he enters within that range either. When it spawns, it just moves to a spot and waits...
  • What are the Waypoint Settings like? Mainly the Patrol Radius if you use random patrol. That should match the other ranges if you limit it.
    A range of 4 is pretty small, so a large random patrol radius can result in a lot of out of range positions.

    Also, what are the enemy detection ranges?
    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!
  • Waypoint Settings was set to the default value = 30.
    I reduced it to the same value as the Move Range value but:
    * eventually the AI stops roaming within that range
    * as soon as the player gets detected the AI seems to freeze until the player gets close enough for an attack (but doesn't chase it regardless of the hunting mode)

    This is the Enemy Detection
    image
  • Can you check the combatant's and the move AI's state via the component's inspector?
    Most likely the battle AI issued an attack on the combatant, i.e. it'll use the move AI to get into range, but at the same time can't due to the move range limitation.
    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!
  • edited February 2024
    This is how it looks like

    Mode = Waypoint
    Use Mode = Hunt
    Target Position = (9,12, 0.00, 3.56)*
    *these coordinates update every few seconds until the player enters the AI move range. Then the AI stops and then they remain the same.
    Target Object = -

    I did a test and disabled Use Auto Stop.
    My understanding was that the auto stop was temporary until a next waypoint was calculated but seems like it's a permanent stop and the waypoint never re-starts afterwards.
    This change prevented the AI to get stuck during the patrol but as soon as the Player enters the scene, it still gets stuck.
    Post edited by ChimpLogik on
  • I'll do some tests, or maybe you can send me a test setup for that.
    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!
  • I will send you how to test the setup via email :)
Sign In or Register to comment.