- Home /
I want to show the percentage towards completion for each level
Hi, first time posting here.
I am making a game where the player is always moving forwards at a fixed pace. I want to create a percentage on the screen in-game that shows what percentage of the distance from the player's starting point to the end point in the level the player has traveled. Any advice?
Thanks!
Answer by Cornelis-de-Jager · Dec 17, 2018 at 05:10 AM
As a base you can start with
Vector3.Distance (startPosition, endPosition); To get propper distance from start to finish. Then use: Vector3.Distance (transform.position, endPosition); To get the distance you still have to go. Then by doing a simple percentage calculation you should be able to get a percentage of completion.
Your answer
Follow this Question
Related Questions
UIToolkit UIProgressBar methods changed 0 Answers
How to create a gradient progress bar 3 Answers
Once the slider has reached maximum value: set Level Complete UI (Active) 1 Answer
progress bar help 1 Answer
Images blocking buttons? 2 Answers