Answer the question
In order to leave comments, you need to log in
How to make a record counter by distance in Unity?
I'm making a casual game, but I can't figure out how to make a record that reads the distance traveled. Well, for example, a player flew 2 meters up and the record began to equal two (2). Approximately (or the same) as in the game Hill Climb Racing.
Unity C#
Answer the question
In order to leave comments, you need to log in
The GameObject has a transform field, which has a position - you take the necessary component there: x/y/z.
You can easily calculate the path by the coordinate
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question