This is something I assume to be fairly simple:
I would like to set up a counter on my HUD for my game that tells the player how far away, in X-coordinates, he or she is from the level-end checkpoint.
So for example, if the player is 3000 pixels away from the checkpoint, the counter will say 3000. And if the player moves 20 pixels to the left, the counter will say 2980. And if the player moves 20 to the right, it will say 3020, and so on and so on.
This particular level I'm making is going from right to left, so I don't know if that would change anything.
The way I've tried to go about this is giving the checkpoint a variable "Distance", and setting it to Checkpoint.X - Player.X , and setting the HUD Text to that, but that only gives a static number, which confused me.
I have a feeling that it has something to do with the System action Compare Values, but I am pretty unversed in actions regarding those.