Simple Status UI (scale the distance)

Hi! I’m having trouble to implement something like the image attached. Basically, I want the progress of the snail away from the flag to be displayed on my HUD. (take a look at the game window of the editor, upper center)

I’m guessing I just need to scale the distance from the moving object to the flag but I have no idea how. Please help!

Thanks!

something with: currentDistance/maxDistance

-with ui button, stretch the button as your red line. Set image typ filled, choose fill method (horizontal maybe). And then in script (dont forget using UnityEngine.UI;): image.fillAmount = currentDistance/maxDistance; This is like hp-bar.

-or with big dot :slight_smile: . This purple object can move from 0 to 100 (as example), so you can check, what distance has your player done: pos =currentDistance/maxDistance. And then move your dot on x with x = 100*pos (as ui or make it child of camera, and then change local x).