Announcement

Collapse
No announcement yet.

Distance for an endless runner

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Distance for an endless runner

    Hello,

    I'm making an endless runner (first project) and trying to learn while making the game. Now I want to display the distance I'm current at (like 500 meters, 1000 meters) but tried differend things but none with succes. I creadet a widget hud (also used for pick up coins like in the unreal tutrial video) binding the number for meters but I dont get the blueprint right for knowing my distance to print it to the screen. Does somebody know the blueprint for knowing the distance the player has run.
    All help is welcome
    Thanks in advance

    Sorry for my bad english my mother language is dutch.

    #2
    You should be able to calculate the distance making your own function, you can get the character velocity and current game time so you just need to use the formula: distance = velocity / time (supposing that your player is always moving at the same velocity (no acceleration) and that he never stops)

    Another solution is to make a fake counter that just adds for example 1 unit for each second (that would not be real distance but user wont know that)
    Last edited by Nesjett; 03-24-2015, 08:07 PM.
    [MARKETPLACE] The forest like gameplay system | building/crafting game
    Dark Souls 2 fighting system style
    Drivable Space Ship
    Run Knight Run | 48h game made
    Unreal Travel | 48h game made

    Comment


      #3
      Well to add on that you can also count unreal units. Just check your current position, compare it against the last one (which you will have to save. You also might want to remove Z here) and take the distance between those and add that to a variable which saves the distance traveled.

      Comment


        #4
        Thanks for the help!!
        I will try it, but at least I know how tto do it now Great thanks for the help

        Comment

        Working...
        X