# Navigation question

**URL:** <https://forums.unrealengine.com/t/navigation-question/57128>\
**Category:** World Creation\
**Tags:** ai-navigation, Navigation, unreal-engine, navmesh\
**Created:** [March 3, 2016, 12:33pm UTC](https://forums.unrealengine.com/t/navigation-question/57128 "2016-03-03T12:33:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanzco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanzco](https://forums.unrealengine.com/u/yanzco)\
**Post date:** [March 3, 2016, 12:33pm UTC](https://forums.unrealengine.com/t/navigation-question/57128/1 "2016-03-03T12:33:21Z")

</div>

hello. i want to ask a question as shown in the image…  
 ![gR978.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/c/a3cb4e050dd7842d558a96488615099ddd285276.png)

i have a nav mesh in my level.  
and when i send my ai to move, to point A to point B.  
the ai would navigate, using the red line.

yes, it is the quickest route.  
but, i was curious if it is possible to make the path look a bit realistic, like the black line…  
making the navigation not to cut corners really sharp…

---

<div class="post-metadata">

**Author:** ![Luftbauch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luftbauch](https://forums.unrealengine.com/u/Luftbauch)\
**Post date:** [March 3, 2016, 12:56pm UTC](https://forums.unrealengine.com/t/navigation-question/57128/2 "2016-03-03T12:56:33Z")

</div>

Use Navmesh modifier to exclude areas AI should not move  
Or setup a targetpoint array and let the ai walk along the targetpoints, on the way to your target, many options.  
🙂

---

<div class="post-metadata">

**Author:** ![yanzco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanzco](https://forums.unrealengine.com/u/yanzco)\
**Post date:** [March 3, 2016, 2:23pm UTC](https://forums.unrealengine.com/t/navigation-question/57128/3 "2016-03-03T14:23:17Z")

</div>

> [@Luftbauch;486064](#):
>
> Use Navmesh modifier to exclude areas AI should not move  
> Or setup a targetpoint array and let the ai walk along the targetpoints, on the way to your target, many options.  
> 🙂

there are walls, so the navmesh already know it is not passable.  
targetpoint array?.. what do you mean by that?..  
something like, waypoint1, waypoint 2 3 … etc ?

now how would i make it set the waypoint automatically as the player set the destination point B

---

<div class="post-metadata">

**Author:** ![Luftbauch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luftbauch](https://forums.unrealengine.com/u/Luftbauch)\
**Post date:** [March 3, 2016, 6:24pm UTC](https://forums.unrealengine.com/t/navigation-question/57128/4 "2016-03-03T18:24:47Z")

</div>

> [@yanzco;486120](#):
>
> there are walls, so the navmesh already know it is not passable.  
> targetpoint array?.. what do you mean by that?..  
> something like, waypoint1, waypoint 2 3 … etc ?  
> now how would i make it set the waypoint automatically as the player set the destination point B

I am really sorry, because i am only novice BP and when i try to show you something, i bet there is a better way, to do that.  
My english is to limited, to teach someone more then breathing with it.  
Here i load the target points in my case into Array.  
 ![456340f47a7ea06d63411da49247bc5c143adeb5.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)  
And here i am extracting them again, but i use random locations. You could check the distance to the next point and choose the next aviable to start track.  
 ![c36c629dd317b09ca3617e0a8a745be23031967e.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)  
I think in your case it would be best to setup a targetpoint grid (at every crossing section, or where the pathdirection changes, but you have to try it out on your own).  
Not to complicated i think.  
🙂

---

<div class="post-metadata">

**Author:** ![yanzco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanzco](https://forums.unrealengine.com/u/yanzco)\
**Post date:** [March 5, 2016, 4:25am UTC](https://forums.unrealengine.com/t/navigation-question/57128/5 "2016-03-05T04:25:26Z")

</div>

sorry for the late reply luftbauch.  
i see now what you meant by using target point…  
so the ai gets all the targe points / waypoints. and check the nearest one and go there…

so, the target points are placed on the middle of the path corners

---

<div class="post-metadata">

**Author:** ![Vollgaser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vollgaser](https://forums.unrealengine.com/u/Vollgaser)\
**Post date:** [March 5, 2016, 12:38pm UTC](https://forums.unrealengine.com/t/navigation-question/57128/6 "2016-03-05T12:38:56Z")

</div>

You can use the navpoint / route system that is in the survival game sample:

> **[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 — ue4community.wiki! You will be able to find content from the official...

But there you have to place the routepoints manually.  
If you want to go for a more realistic automated route, i would suggest to keep a minimum distance to the borders of the navmesh, like 1 meter for example.  
As a human you would go the original red line from A to B with some distance to the walls.

If you want more of a robot/drone behaviour that really goes in the middle of the paths, then i would set up manually a mesh of navpoints, its quick to do.

---

<div class="post-metadata">

**Author:** ![yanzco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanzco](https://forums.unrealengine.com/u/yanzco)\
**Post date:** [March 7, 2016, 3:08pm UTC](https://forums.unrealengine.com/t/navigation-question/57128/7 "2016-03-07T15:08:25Z")

</div>

i have more question for using the waypoints…

so if destination is set, then the ai gets all waypoints to an array  
then gets the closest one then moves to it.

now the question is, if going to the destination, the character has to cross 10 waypoints…  
what i get is only the first step, go to nearest waypoint in array.  
then whats next?

how does the ai find the next waypoint to go to to get nearer the destination after it reaches the first waypoint…?
