Do I need a navmesh to move and use behavior tree if my “AI” is flying and I am not using any pathfinding?

My game project is about flying in space. I would like to make an AI that:

  1. Flies straight towards an actor

  2. Looks at another actor

  3. Shoots when it is within range of a third actor

I see lots of good tutorials on walking AI, which do these same things but they of course all use navmeshes and pathfinding. If I use neither, can I still use the behavior tree, blackboards, etc.?

Am I only giving up the obstacle avoidance, because that I can totally live with, or will all the tutorials be a waste of time if I am only interested in flying AI?

UPDATE: I ended up using projectile movement, homing projectile.

You might be looking for MoveDirectlyToward

If it’s a 2D space game you could get away with a nav mesh I suppose as long as it’s on an xy plane. If it’s 3D you could check out DoN’s 3D Pathfinding for Flying AI though I haven’t used it personally.

Thanks, I will look into move directly towards.

It’s 3D. I am familiar with DoN’s pathfinding, but I think it’s not intended for my type of project. I end up with too many voxels. And I don’t really need obstacle avoidance, I just need to be able to chase an actor. I guess I could try using move to actor with DoN and turning pathfinding off, maybe then I could potentially just use one single huge voxel.

I guess I didn’t actually answer the question in your post, so for a bit more on that:

Behavior trees work fine without a nav mesh. Obviously you won’t be able to use nodes that utilize one, but otherwise they are different systems.

Flying toward an actor:
One method I’ve used in the past is to use EQS to find a place to go that has visibility to the player. There are a lot of ways to do that, but in it’s most simple form you perform frequent line traces to determine if you can see the player and if not the EQS finds a location around the blocking object to go to. Getting the behavior you want is then just a matter of experimenting with different tests. And as said before, MoveDirectlyToward will move without a nav mash. You can set a “target” location, and have the actor move every frame in that direction until it gets there.

Looking at an actor:
Take a look at this overview.

Shooting within range of an actor:
This is very open ended, but GetDistanceTo will give you the distance, so you check that then react when it’s <= a value.


That’s very good to know. I think I will try to start out as simply as possible.

MoveDirectlyToward requires a navmesh to be present, even though it doesn’t use it. Very annoying!
See Unreal Engine Issues and Bug Tracker (UE-30962) BT node responsible for moving the cube is configured to project move goal location to navmesh

Tried using the MoveDirectlyToward without a nav mesh and nothing happens. Everything I’m reading online says it’s required.