Need Help with: Single Tap, Double Tap, and Drag

VoidedSkyVoidedSky Member Posts: 1,095
edited November -1 in Working with GS (Mac)
Hey guys, this problem has caused me enough stress.... I have spent hours trying to figure this out... How would I have an actor that would do this:

When tapped(pressed and released) once before .25 seconds, It would become selected
When tapped twice (released twice) within .25 seconds, it would destroy.
When touch is held on, it would constrain to the touch position.

Does anyone have any ideas?

I have gotten some parts of this, but then there is always a part that just doesn't work. :'-(

Thanks!
~CTM

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    your right there lol.

    For tap: Have it whatever when touch is pressed or released (obvioously ;)

    For double tap: Make 2 interger attributes tap 1 and tap 2, and set them to 0. Have when touch is pressed change attribute tap 1 to 1. Then have a timer with run to completion check after .5 seconds change tap 1 to 0. Then have another rule when touch is pressed, and tap 1 =1, change tap2 to 1. Have another rule when tap 2=1 then put a timer with run to complete after .7 seconds change attribute tap 2 to 0.

    Whatever behaviors you want to happen when theres a double tap, have them happen when tap 2 =1.

    And then for drag have when touch is pressed and when touch is inside constrain attribute self position x to mouse position x and self position y to mouse position y.

    Hope i helped
  • VoidedSkyVoidedSky Member Posts: 1,095
    Thanks John,
    I've basically had some variation of that, and I just tried that, and It doesn't work, because when touch is pressed, it changes tapOne to 1, and then the rule for the second one is true, so when you press it once, it changes tapOne, and tapTwo to 1 at the same time. I also tried to make it so when touch is released instead of pressed, but I had the same outcome. ;-(
    Anyone got any other ideas?
    ~CTM
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Change the value back to 0 after releasing?

    Ace
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Ill make a quick demo for ay
  • VoidedSkyVoidedSky Member Posts: 1,095
    mynameisace said:
    Change the value back to 0 after releasing?

    Ace

    Hmmmmm, I don't think that this will work, because I need to be able to check that attribute in the game.
    ~CTM
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    For tap 1 have when touch is released change tap 1 to 1, with a timer after it that says when tap 1=1 after .5 seconds change attribute tap 1 to 0 with run to completion checked. Then have when touch is pressed and tap 1 =1 (when all conditions are valid) change tap 2 to 1. After .5 seconds change attribute tap 2 to 0

    forgot the first tap should be on release, i also made a quick demo if youd like it
  • VoidedSkyVoidedSky Member Posts: 1,095
Sign In or Register to comment.