How to make a progress bar increase as it gets closer to an object?

In my current game, I only want to allow my character to travel so far so I made an invisible wall spawn a certain distance from the player but I want the player to be able to tell when he’s reaching that point with a progress bar. How can i make the progress bar increase as it gets closer to the object?

Please don’t create multiple of the same thread. you made a post which is exactly the same thing yesterday. if you want to bring your question back to the top then bump it. by creating multiple threads you are making a mess of things and making it harder for people to help you and for others that may have the same issue to find the help they need later.