# How can I translate a line trace hit location into points on a UI image?

**URL:** <https://forums.unrealengine.com/t/how-can-i-translate-a-line-trace-hit-location-into-points-on-a-ui-image/1753068>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [March 15, 2024, 12:43am UTC](https://forums.unrealengine.com/t/how-can-i-translate-a-line-trace-hit-location-into-points-on-a-ui-image/1753068 "2024-03-15T00:43:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [March 15, 2024, 3:29am UTC](https://forums.unrealengine.com/t/how-can-i-translate-a-line-trace-hit-location-into-points-on-a-ui-image/1753068/5 "2024-03-15T03:29:54Z")

</div>

you needd to remap one range to another range.

Let’s take the following information:

- the (center) position of your target.
- the positions of your spread shots.

You measure the following situation:

- Shot 1 is 10cm up and 10 cm to the right of the target’s center position.

if you imagine the target’s most left position you want to measure as 0% and the most right position as 100%, you can say the shot is at X % horizontally of the target’s size. Do the same vertically. now you have mapped the shot position to a 0 to 100 range for both X and Y axis. You can use the percentage to modify your UI per shot.

Instead of say spawning a “dot” widget for every shot maybe someone can come up with a fancy shader for the UI. Unreal’s UI is [horrible on performance](https://forums.unrealengine.com/t/bug-report-bad-widget-performance-slate-processmousemove/506125) with these kind of things.

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-translate-a-line-trace-hit-location-into-points-on-a-ui-image/1753068)._
