# Find closest path to the target on the hexagon map

**URL:** <https://forums.unrealengine.com/t/find-closest-path-to-the-target-on-the-hexagon-map/451719>\
**Category:** Blueprint\
**Tags:** pathfinding, unreal-engine, UE4, Blueprint, question\
**Created:** [July 4, 2019, 6:23pm UTC](https://forums.unrealengine.com/t/find-closest-path-to-the-target-on-the-hexagon-map/451719 "2019-07-04T18:23:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![t0msk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t0msk/32/614638_2.png) [@t0msk](https://forums.unrealengine.com/u/t0msk)\
**Post date:** [July 4, 2019, 6:23pm UTC](https://forums.unrealengine.com/t/find-closest-path-to-the-target-on-the-hexagon-map/451719/1 "2019-07-04T18:23:13Z")

</div>

Hello,

I have problem with finding closest path from start point to the target, as you can see on the picture, blue hexagon represents start point, red hexagons represent blocade (you cannot go over these hexagons), green hexagon represents target and yellow hexagons represent closes path (what I have to find).

My current logic is that, every hexagon is Blueprint class which has 6 references (to each side) to neighbour hexagons (so I can “travel”), but I don’t know how to find a some good and **simple** algorithm for finding that path.

I really appreciate any help, thank you.

 ![281481-haxagon-map-problem.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/8/7f82a170082091068ae0c61afab114838bc76cfe.jpeg)

---

<div class="post-metadata">

**Author:** ![KristofMorva](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kristofmorva/32/1194508_2.png) [@KristofMorva](https://forums.unrealengine.com/u/KristofMorva)\
**Post date:** [July 4, 2019, 10:29pm UTC](https://forums.unrealengine.com/t/find-closest-path-to-the-target-on-the-hexagon-map/451719/2 "2019-07-04T22:29:01Z")

</div>

The common `A*` algorithm is both fairly simple and should perform well.

An example: [Implementation of A\*](https://www.redblobgames.com/pathfinding/a-star/implementation.html)

---

<div class="post-metadata">

**Author:** ![t0msk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t0msk/32/614638_2.png) [@t0msk](https://forums.unrealengine.com/u/t0msk)\
**Post date:** [July 16, 2019, 3:16pm UTC](https://forums.unrealengine.com/t/find-closest-path-to-the-target-on-the-hexagon-map/451719/3 "2019-07-16T15:16:28Z")

</div>

Thanks, I thought that UE4 has something implemented for it 🙂 But anyway thanks 🙂
