Endless runner distance

Hi i am making an endless runner 2d game.

In my game the character doesn’t move, the backgruond instead moves and destroys when it touch an object (Destroyer).

How can i calculate the distance that tha player “runs” from the beginning to the end of the game ?

Thank you :wink:

Since you are moving the background transform then you know how much it’s moved, just increase a variable by the movement value. Isn’t it?

If your player is running at a constant speed then just use time.