Need help with distance

hi im ctg i need help
https://i.gyazo.com/thumb/1200/111167f4084d0c87f9c27868b384e8b0-png.jpg
im making distance bar player - part but it in ui
who have idea to make this?

1 Like

What do you want the bar to do?

https://gyazo.com/797b1c0a95fdb30c01b09968b65298eb for this
i have communision

1 Like
local TotalDistance = (End.Position - Start.Position).Magnitude --Total distance from start to end. 
local Distance = Player:DistanceFromCharacter(End.Position)
local DistanceFraction = Distance / TotalDistance --Ratio of the player's current distance and the total distance.
DistanceFraction = (1 - math.min(DistanceFraction, 1)) --Clamp the result between 0 and 1.
PlayerImage.Position = UDim2.new(DistanceFraction, 0, PlayerImage.Position.Y.Scale, 0)

This is pseudo-code but should help you figure out what you need to do.

wow thank it work i thought it too hard, ima improve my math skill lol

i still not understand too much now, it very make me confuse