# Can I use ProjectPointToNavigation in C++?

**URL:** <https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793>\
**Category:** AI\
**Tags:** Navigation, projection, unreal-engine, vector, question, CPP\
**Created:** [March 20, 2015, 12:29am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793 "2015-03-20T00:29:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jechli\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jechli\_1](https://forums.unrealengine.com/u/jechli_1)\
**Post date:** [March 20, 2015, 12:29am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/1 "2015-03-20T00:29:00Z")

</div>

I’m just wondering if there is a C++ version of the blueprint function ProjectPointToNavigation. I’ve gone through the list of functions that a vector uses and PointPlaneProject is probably the closest to what I want to use (though at this point I’m not sure how to get a reference to a nav mesh plane).

---

<div class="post-metadata">

**Author:** ![mirsabayu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mirsabayu](https://forums.unrealengine.com/u/mirsabayu)\
**Post date:** [March 20, 2015, 12:46am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/2 "2015-03-20T00:46:58Z")

</div>

Is it project point to navigation for aicontroller?? If it’s like that i think it is a cpp function. Try to look at aicontroller function moveToActor and moveToLocation

---

<div class="post-metadata">

**Author:** ![MarcAndreG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MarcAndreG](https://forums.unrealengine.com/u/MarcAndreG)\
**Post date:** [March 20, 2015, 1:09am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/3 "2015-03-20T01:09:20Z")

</div>

You can find ProjectPointToNavigation in NavigationSystem.h

two definition for you

```
	bool ProjectPointToNavigation(const FVector& Point, FNavLocation& OutLocation, const FVector& Extent = INVALID_NAVEXTENT, const FNavAgentProperties* AgentProperties = NULL, TSharedPtr<const FNavigationQueryFilter> QueryFilter = NULL)

```

and

```
	bool ProjectPointToNavigation(const FVector& Point, FNavLocation& OutLocation, const FVector& Extent = INVALID_NAVEXTENT, const ANavigationData* NavData = NULL, TSharedPtr<const FNavigationQueryFilter> QueryFilter = NULL) const;

```

And you can use it with something like this

```
FNavLocation NavLoc;
FVector QueryingExtent = FVector(50.0f, 50.0f, 250.0f);
FNavAgentProperties NavAgentProps;
//Set you NavAgentProps properties here (radius, height, etc)
	bool bProjectedLocationValid = GetWorld()->GetNavigationSystem()->ProjectPointToNavigation(GetActorLocation(), NavLoc, QueryingExtent, MyNavData);

```

Hopes this helps

Cheers,

- Marc

---

<div class="post-metadata">

**Author:** ![jechli\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jechli\_1](https://forums.unrealengine.com/u/jechli_1)\
**Post date:** [March 20, 2015, 4:25pm UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/4 "2015-03-20T16:25:16Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ea653d2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ea653d2c](https://forums.unrealengine.com/u/anonymous_user_ea653d2c)\
**Post date:** [July 1, 2019, 4:37am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/5 "2019-07-01T04:37:09Z")

</div>

Hello~ Can you please tell me where can I get MyNavData?  
I search everywhere I have no clue for how to get them.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ea653d2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ea653d2c](https://forums.unrealengine.com/u/anonymous_user_ea653d2c)\
**Post date:** [July 1, 2019, 4:40am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/6 "2019-07-01T04:40:45Z")

</div>

Thank you !

---

<div class="post-metadata">

**Author:** ![TigerFish89](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TigerFish89](https://forums.unrealengine.com/u/TigerFish89)\
**Post date:** [September 20, 2019, 1:38am UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/7 "2019-09-20T01:38:29Z")

</div>

Hi. Where can I get MyNavData?

---

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [January 15, 2025, 9:14pm UTC](https://forums.unrealengine.com/t/can-i-use-projectpointtonavigation-in-c/311793/8 "2025-01-15T21:14:06Z")

</div>

Something like that  
`ARecastNavMesh* FoundNavMesh = Cast<ARecastNavMesh>(UGameplayStatics::GetActorOfClass(GetWorld(), ARecastNavMesh::StaticClass()))`
