DoN's 3D-Pathfinding / Flying-AI system (with full source!)

Your approach looks correct, but this kind of setup needs a lot of careful fiddling and state management to get right. It is perfectly normal that it’s not working yet :slight_smile:

Things to watch out for:

  1. If distance threshold is exceeded you should promptly update the new destination onto “BB Key Target Location” or bot will not fly to new destination. I’m not seeing you do this in the screenshots!

  2. “BB Key Target Location” should never be updated while the bot is busy chasing. That will mess with your distance check. I can’t see where you’re setting this value from so I thought it worth mentioning.

  3. Initial state of the “abort boolean” should always be true, thus allowing the upstream decorators (DummyState->Distance) to flow unhindered to FlyTo.

  4. Corollary of #2 - Each time a new pursuit begins (i.e. Patrol to Combat switch) you should reset the boolean to true to start on a clean slate.

So I think you get the picture - all these are potential failure points. Take the time to slowly work through the end-to-end execution, it’s a great opportunity to perfect your BT knowledge too!