Distance traveled????

Say i want to measure how far a ball can go up. How would i measure that and tell the player how far the ball traveled up at the end of the game? Screenshots would be extremely helpful

Comments

  • ArmellineArmelline Member, PRO Posts: 5,368

    It'll really depend on how you're moving the ball, how you trigger it, how it's brought down again/if it's brought down again. Perhaps use something like this, though:

  • kylemik23kylemik23 Member Posts: 7

    i couldn't thank you any more. THHHHAAAAANMKKKKKKKKKKK UUUUUU

  • ArmellineArmelline Member, PRO Posts: 5,368
  • KnightStarKnightStar Member Posts: 162

    @Armelline Question - How would you calculate the distance traveled if you were using a scrolling background? Say you were launching a rocket (ie Kerbal Space program) and you had a scrolling sky background but wanted to know how far your rocket flew upwards?

    Thanks!

  • ArmellineArmelline Member, PRO Posts: 5,368

    @KnightStar said:
    Armelline Question - How would you calculate the distance traveled if you were using a scrolling background? Say you were launching a rocket (ie Kerbal Space program) and you had a scrolling sky background but wanted to know how far your rocket flew upwards?

    You could do it the same way, you'd just need to take into account the amount the camera had moved. So you'd need to record the camera's starting position (likely 0,0), and then track how far it moves in relation to the moving object. This is pretty simple if your camera's tracking area is very small (i.e. the size of the moving object or smaller) but needs a little more maths if you're using a bigger tracking area (as you need to calculate how far the object moves before the camera starts moving, then add it to the distance the camera moves for the final distance).

Sign In or Register to comment.