Demo1 Distance Check and Lose Target after spotted

Forums 💬 NodeCanvas 🗨️ General Discussion Demo1 Distance Check and Lose Target after spotted

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14772
    gotcakes
    Participant

      Hi Gav / Others

      I’m genuinely sorry to have to ask this as it’s a BT question in general rather than NodeCanvas but I’ve lost the plot a little, would appreciate a leg up 🙂

      If we took Demo1 for example, there’s a LOS and Target-in-Front check. If we were to say that both of these were successful then what I’d like is the agent to follow the target indefinitely until a certain distance is exceeded, and if exceeded would then go back to the LOS/Front conditions and not before hand, and continue to wander to waypoint.

      I’ve tried numerous things including setting/checking a BB Bool for ‘discovered’ but to no avail, I’m literally going round in circles, my canvas right now looks quite the mess 🙂

      Sincerely appreciate any help
      Regards

      #14774
      Gavalakis
      Keymaster

        Hello,

        No problem, feel free to ask anything related 🙂

        If I understand you correctly, then you simply need to add another condition (if distance to target < 10) child of the same Dynamic Sequencer that has the LOS, InFront checks.
        As such, if the condition is not met (target exceeds a certain distance), then the soldier will continue patroling.
        I’ve attached the BT changed.

        Let me know if that’s what you mean.
        Cheers

        #14773
        gotcakes
        Participant

          Hi Gav,

          Thanks for getting back to me. Really appreciated.

          It’s a bit more complicated than that as I wanted the soldier to continue the MoveToTarget even if the LOS is broken. So the LOS check is only evaluated once.

          I think I’ve got it now although I’ve probably made it more complex than necessary.

          1. Removed the Dynamic for Check if in Sight
          2. Added a distance check next to the LOS
          3. Added an inverted distance check before the GoToTarget

          So something like the attached pic

          Probably can be done easier than this but it’s working for now 🙂

          Cheers

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.