# Best Way to Move a Ship Across a UI Map

**URL:** <https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889>\
**Category:** UI\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [May 4, 2025, 12:57pm UTC](https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889 "2025-05-04T12:57:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![faizanuar08](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@faizanuar08](https://forums.unrealengine.com/u/faizanuar08)\
**Post date:** [May 4, 2025, 12:57pm UTC](https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889/1 "2025-05-04T12:57:27Z")

</div>

I have a map inside my UI, and I’m trying to figure out how to make a ship move across it, traveling from city to city. Right now, I’m using the marketplace UI spline, but creating a spline for each route is too much. Is there a more efficient way to handle this? Any guidance would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![RedGrimnir](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/redgrimnir/32/1054683_2.png) [@RedGrimnir](https://forums.unrealengine.com/u/RedGrimnir)\
**Post date:** [May 4, 2025, 1:02pm UTC](https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889/2 "2025-05-04T13:02:15Z")

</div>

Can help with this but to have a decent answer.

First this is UI based game, the ship does not exist on 3D world? Is this right?

Do you have C++ knowledge?

---

<div class="post-metadata">

**Author:** ![faizanuar08](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@faizanuar08](https://forums.unrealengine.com/u/faizanuar08)\
**Post date:** [May 4, 2025, 1:09pm UTC](https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889/3 "2025-05-04T13:09:37Z")

</div>

I am making 3D game, and the ship only exists in the UI when i open the UI Map —it’s not part of the 3D world. So the movement needs to be handled entirely within the UI system. Unfortunately, I don’t have C++ knowledge and can only use Blueprints

---

<div class="post-metadata">

**Author:** ![RedGrimnir](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/redgrimnir/32/1054683_2.png) [@RedGrimnir](https://forums.unrealengine.com/u/RedGrimnir)\
**Post date:** [May 4, 2025, 2:06pm UTC](https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889/4 "2025-05-04T14:06:47Z")

</div>

Understood. No worrries can be done too, however we will walk around the problem a little bit.

I will try to demonstrate how to do it step by step.

1. We need to map image into data where ship can move to and not move to. Swimable NotSwimable
2. On this data created we will convert it to a data array.
3. We will run a pathfinding alghorithm on this data.
4. Show the output as data (line) and move ship.

After this want to give details technically how to do it to get you going.

1. We have a map image (I will find something easy from google)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/2/9e2dbea155bfc6750e28e99a264c61e15eee971f.jpeg)

1. We want to convert this into a data, so how can we do it.  
Option A : You do it manually by hand.  
Option B : You put this image into an actor, get a capture with SceneCaptureComponent2D, set a low res texture target like 128\*128 (which give 16384 data points), and read render target raw. If you photoshop image a bit you can get a good data. We can extract if that pixel is swimable or not as data. Use this [node](https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Rendering/ReadRenderTargetPixel) to read pixels and convert them to data.  
Image data should be something like below White Swimable, Black NotSwimable. This should be preferable done before begin play in editor but can be ok to do once in begin play and keep that. Since its quite a slow operation.

![DataImage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/f/e7fbe3c6ccdd1c49ffb990614c2bc56b4a34a814.png)

Enlarged Version Of Data Image

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/b/d5b3b37a28c01b3f84806d8bdbbd65aa472da9c8.png)

As said you can convert this by hand as,  
---- Coordinate X, Coordinate Y, 0-1 Swimable or not  
or you can read pixels with other method and save them.

3.Now we have to run a pathfinding alghorithm. There is many alghorithms and fundamentally they can be done with blueprints, there are some in code base already however we have to implement ours. I found [this](https://dev.epicgames.com/community/snippets/eeeB/unreal-engine-simple-a-a-star-navigation-blueprint-implementation?locale=tr-tr&locale=es-mx) while searching.  
Also you can use Dijkstra’s algorithm which is slower but easier to implement, found [this](https://github.com/salvatorespoto/DijkstraBlueprint) while searching, also there is some [plugins](https://www.fab.com/listings/c76da69d-73b9-42a1-b958-a29c3eaf07c8) that is [done](https://www.unrealengine.com/marketplace/en-US/product/easypaths)

There is this [youtube tutorial](https://www.youtube.com/watch?v=8odkg8LDUIQ) based on level generation however its the same so if you implement you can pathfind to ship to the next city.

* * *

However all this being said, if your map is loaded you know the ship position and destination. You can always use built in AI pathfinding to calculate splines draw it on map without manually doing it if you navmesh and agents setup correctly. Just mentioning it to put you in right direction. Cause if its a 3d game its a 3d game, you can use engine’s built in advantages. You can basically  
Find Path  
Get Path Points  
Convert them to Screen position

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/9/a8952796a44bf3d5bb62d31717d454c12155354b.png)

---

<div class="post-metadata">

**Author:** ![faizanuar08](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@faizanuar08](https://forums.unrealengine.com/u/faizanuar08)\
**Post date:** [May 4, 2025, 3:15pm UTC](https://forums.unrealengine.com/t/best-way-to-move-a-ship-across-a-ui-map/2489889/5 "2025-05-04T15:15:19Z")

</div>

I honestly don’t know what to say. I wasn’t expecting someone to take the time to provide such a long and detailed solution. I haven’t had the chance to try it yet, but regardless, you have my respect. Thank you!
