# FindPathToActorSynchronously() function not working!

**URL:** <https://forums.unrealengine.com/t/findpathtoactorsynchronously-function-not-working/436905>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 2, 2018, 3:57pm UTC](https://forums.unrealengine.com/t/findpathtoactorsynchronously-function-not-working/436905 "2018-11-02T15:57:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![terabhai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@terabhai](https://forums.unrealengine.com/u/terabhai)\
**Post date:** [November 2, 2018, 3:57pm UTC](https://forums.unrealengine.com/t/findpathtoactorsynchronously-function-not-working/436905/1 "2018-11-02T15:57:02Z")

</div>

Im having a problem using the following Code:

```
ACharacter *PlayerPawn = UGameplayStatics::GetPlayerCharacter(this, 0);
UNavigationPath *NavPath = UNavigationSystemV1::FindPathToActorSynchronously(this, GetActorLocation(), PlayerPawn);

```

The function FindPathToActorSynchronously() is not accepting its third argument as an ACharacter.

Following Headers are included:  
#include “STrackerBot.h”  
#include “Components/StaticMeshComponent.h”  
#include “Kismet/GameplayStatics.h”  
#include “NavigationPath.h”  
#include “AI/NavigationSystemBase.h”  
#include “NavigationSystem.h”

Errors:

2\>D:\Unreal Engine\UE\_Projects\COOP\Source\COOP\Private\AI\STrackerBot.cpp(36): error C2664: ‘UNavigationPath \*UNavigationSystemV1::FindPathToActorSynchronously(UObject \*,const FVector &,AActor \*,float,AActor \*,TSubclassOf)’: cannot convert argument 3 from ‘ACharacter \*’ to ‘AActor \*’

2\>D:\Unreal Engine\UE\_Projects\COOP\Source\COOP\Private\AI\STrackerBot.cpp(36): note: Types pointed to are unrelated; conversion requires reinterpret\_cast, C-style cast or function-style cast

---

<div class="post-metadata">

**Author:** ![NoCodeBugsFree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoCodeBugsFree](https://forums.unrealengine.com/u/NoCodeBugsFree)\
**Post date:** [November 16, 2018, 2:45pm UTC](https://forums.unrealengine.com/t/findpathtoactorsynchronously-function-not-working/436905/2 "2018-11-16T14:45:59Z")

</div>

Hi!  
check NavigationSystem module added in ProjectName.Build.cs file  
PublicDependencyModuleNames.AddRange(new string[] { “NavigationSystem” });

---

<div class="post-metadata">

**Author:** ![UnrealEngine](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealEngine](https://forums.unrealengine.com/u/UnrealEngine)\
**Post date:** [December 17, 2018, 2:58pm UTC](https://forums.unrealengine.com/t/findpathtoactorsynchronously-function-not-working/436905/3 "2018-12-17T14:58:37Z")

</div>

太感谢了 ~~~教程里面老师没有说添加模块~~~
