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

Simply put - you can’t tell a bot to travel inside a floor or a solid brick wall or inside a player’s collision geometry (more on this below) and expect it to work. It has to be an empty/free/open spot that no physX collision body is occupying. The plugin tries its best to find alternate spots for you but if it can’t, you’ll see the “invalid destination” (or origin) error message.

3D pathfinding is complex to use and debug, there’s no way around that I’m afraid. It took me more than one year to perfect 3D navigation for my bots and it still has some rough edges. You’ll have to decide whether that level of technical complexity is something you have bandwidth for in your project.

Now since your bot’s destination is the player itself, it’s highly possible your pawn’s mesh or weapon or some other prop is sharing a collision channel with the navigation obstacle channels (WorldStatic/WorldDynamic by default). A pawn’s collision geometry should not be allowed to interfere with pathfinding. If it does you’ll see the kind of log errors you posted. Configuring all collision channels in your project to play nicely with the navigation system will take time to get right.

It’s almost exactly the same as your current distance check, you’ll just need to do it in your Service node and use a blackboard boolean to force aborts on FlyTo whenever you need to. Instead of checking the distance between your player and the bot this new function will simply check the distance between the player and the last known location of the player that the bot is currently traveling to (i.e. the value of “FlightLocationKey” blackboard key). If it exceeds a delta threshold you abort FlyTo.

To implement this you’ll need a solid understanding of how BT Aborts work, how the “Abort On Value Change” functionality works and on how to use blackboard booleans as decorators in general. This will definitely take a lot of time and patience to setup if you’re new to behavior trees so try to go slow and be prepared to set aside a few days or even a week for getting it right.