# NavMesh, PathFollowing & Filters

**URL:** <https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [February 6, 2015, 9:48am UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436 "2015-02-06T09:48:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_945031d2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_945031d2](https://forums.unrealengine.com/u/anonymous_user_945031d2)\
**Post date:** [February 6, 2015, 9:48am UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/1 "2015-02-06T09:48:56Z")

</div>

Hi!

There are navigation mesh and pawns which are moving according to that meshes. As I can assume, I can somehow influence on formation of following path through filters. But there are totaly none of documentation about how to do it right. When I should influence (in which method)? How to do it properly? Maybe there are some examples.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_945031d2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_945031d2](https://forums.unrealengine.com/u/anonymous_user_945031d2)\
**Post date:** [February 9, 2015, 3:03am UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/2 "2015-02-09T03:03:39Z")

</div>

Noone knows ?

---

<div class="post-metadata">

**Author:** ![kamrann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kamrann](https://forums.unrealengine.com/u/kamrann)\
**Post date:** [February 9, 2015, 7:45am UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/3 "2015-02-09T07:45:16Z")

</div>

I don’t know but would also be interested. I suggest you post the question on AnswerHub, making sure to add the AI tag. The UE4 devs are much more likely to see it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_945031d2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_945031d2](https://forums.unrealengine.com/u/anonymous_user_945031d2)\
**Post date:** [February 10, 2015, 8:37am UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/4 "2015-02-10T08:37:20Z")

</div>

As I can assume, developers answering only on bugreports in answerhub. I have a couple of topics not in this category and there are no answers.

---

<div class="post-metadata">

**Author:** ![kamrann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kamrann](https://forums.unrealengine.com/u/kamrann)\
**Post date:** [February 10, 2015, 10:30am UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/5 "2015-02-10T10:30:23Z")

</div>

It’s true at the moment it’s difficult to get direct help, however Miezsko who is working on AI fortunately seems to be an exception. Make your question specific, add the AI tag and I would think he’ll give you some feedback when he has the chance.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [February 12, 2015, 8:20pm UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/6 "2015-02-12T20:20:36Z")

</div>

Hi ,

Have you taken a look at the wiki tutorials? There are quite a few tutorials on AI, specifically on guards, following specific paths, etc. Perhaps you can find something that will give you an idea of how to move forward? I am going to pass this information on to be considered for future documentation as well but that may be a place to start!

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![anon26705860](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon26705860](https://forums.unrealengine.com/u/anon26705860)\
**Post date:** [February 12, 2015, 8:32pm UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/7 "2015-02-12T20:32:18Z")

</div>

There aren’t any tutorials or examples for using navigation path filters in unreal. The only information that might be helpful would be outside Unreal recast information but that might be even more complicated than what people desire. The majority of the AI tutorials are for more simpler AI.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [February 12, 2015, 8:32pm UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/8 "2015-02-12T20:32:56Z")

</div>

**How to Influence Exact Path Following Behavior**

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/3/f3b23033350cd61852fa8c26cd87bc36076d0184.gif)  
Hi there!

As gif above shows there is a way to modify standard UE4 pathing via C++ to introduce customized path following behavior without rewriting the whole system.

In gif above I am telling the unit how to jump from one nav mesh piece to another using only C++ (nothing was placed in the editor other than basic nav mesh, and I can add new level geometry any time)

You need to do several things

1. Have your own Custom ai controller (extends AAIController)

````auto

2. Tell ai controller to use custom path following component, which extends the base UE4 class

Here's the code for that, you just modify the constructor

```

// UJoyPathFollowComp is used here!
AJoyController::AJoyController(const FObjectInitializer& ObjectInitializer)
   : Super(ObjectInitializer.SetDefaultSubobjectClass< **UJoyPathFollowComp** >(TEXT("PathFollowingComponent")))
{

```

````

1. Make sure your build.cs is including AIModule as part of your dependencies

```auto

PublicDependencyModuleNames.AddRange(new string] { 
	"Core", 
	"CoreUObject", 
	"Engine", 
	"InputCore" ,
        "Landscape",
       "UMG",

        "PhysX", "APEX",

	"AIModule" //< ~~~~~~
});

```

1. Override these functions in your custom PathFollowingComponent!

Especially \*\*FollowPathSegment \*\*!

This is where you can take control of exact pathing methods!

```auto

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Per Tick Modification of Path Following
// this is how you really customize 
// how units follow the path! 

/** follow current path segment */
virtual void FollowPathSegment(float DeltaTime) override;

/** sets variables related to current move segment */
virtual void SetMoveSegment(int32 SegmentStartIndex) override;
	
/** check state of path following, update move segment if needed */
virtual void UpdatePathSegment() override;

```

```auto

**Video Result**

Using the above method is how I made custom C++ Jump pathing calculations that dont need any in-editor additions to the level, just the basic nav mesh volume.

https://www..com/watch?v=0GX-1x-wACI

**More of my customized C++ AI Pathing Videos**
https://forums.unrealengine.com/showthread.php?25410--s-Multi-Threaded-Dynamic-Pathing-System-Full-Physics-Support&p=129896&viewfull=1#post129896

:)

PS:

turned this into a wiki here
https://wiki.unrealengine.com/AI_Navigation_in_C%2B%2B,_Customize_Path_Following_Every_Tick
```

---

<div class="post-metadata">

**Author:** ![anon26705860](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon26705860](https://forums.unrealengine.com/u/anon26705860)\
**Post date:** [February 12, 2015, 9:06pm UTC](https://forums.unrealengine.com/t/navmesh-pathfollowing-filters/20436/9 "2015-02-12T21:06:37Z")

</div>

There’s no need to change the default path following or crowd following component. The filters exist to work with the NavAreas in the environment and influence the default A\* heuristics. There just aren’t any examples as said by the OP.
