Hey All, im looking for an easy way to light up an LED-Bar at the closest point to the player.
It should work with straight or curved LED-Bars.
My first bet would be to use the “find location closest to world location” to find the closest point on a spline. Im unsure on how to use that location to light up the Led-bar.
To find closest, most brute force way is to make array of locations of LED in local space of player (or just distance vectors from player to LED) then sorting them by length, or for loop and remembering shortest.
Another way find closest column, then closest LED in that column. (If panel is bent only in one axis)
How do you lit one LED you want? That depends how you make them lit or unlit.
With dynamic material instance, you can just tell closest panel, to swap material to lit.
You can also look into that look into UI material Examples on marketplace/fab. There is nice LED material, some functions to create it etc. It can be modified to lit LED Cells around UV coordinates.
Hey, thanks for the reply. Im open to all of the suggestions you named. The LED part ist not important at all. So the goal is just to show the nearest point of a curved object to the player.
Currently I have a widget as a texture on a static mesh. My idea was to move a rectangle on the widget in relation to the position of the player.