Announcement

Collapse
No announcement yet.

Player walks/stops toggle

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

    Player walks/stops toggle

    hi there, here´s another one

    I´ve got a sidescroller player character (for mobiles, means which touch input) who walks automatically from left to right.

    I want this to happen:

    - when I touch once, he should jump
    - when I touch twice (or better said, "double tap"), he should stop and go along again when I re-double tap.

    I´ve come along to this point (see below picture), but for some reason he jumps also when I double tap, after he stopped.

    I feel I am close to the solution but can´t figure it out...

    any hints?

    pjClick image for larger version

Name:	player_walks.jpg
Views:	1
Size:	176.3 KB
ID:	1171342

    #2
    Because a double tap is still a tap. So it's going to do that as well.

    You have a sequence in there so it will run through both of those things without anything stopping it from jumping.

    You will want to do another check after your delay to see if the click number was higher, or set a variable from your double tap and check if its false before triggering your jump. Still seems like it will be prone to error either way or you will have a delay before you jump all the time which is unlikely something that you want.

    Comment


      #3
      Have one half of the screen be the "tap to jump" part, and the other half be the "tap to stop/go" part instead?
      Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

      Comment


        #4
        @ 6ixpool: How would you do that? can you define which "region" of the screen can be touched?

        greets

        pj

        Comment

        Working...
        X