Touch Controls - Left/Right but hold down to attack

baronedevelopbaronedevelop Member, PRO Posts: 9
edited September 2014 in Working with GS (Mac)

I have some rules where the hero can be moved left and right by touch. I want the player to attack when holding touch down after 0.5 seconds. This is all working but the issue is when the player moves left and right for >=0.5 seconds the player attacks. I want the attack to happen only when touch is not moved left and right but held place. I need help figuring out the rule to detect if touch is pressed but not moved to attack. Thanks for any help.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    How does the action that triggers the attack differ from the action that makes the character move ?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    I have a code snippet template the does that. It was designed for a run jump but can be modified for run/attack. I'm on my iPad but I'll find it and post it.

  • baronedevelopbaronedevelop Member, PRO Posts: 9

    Guru: Thanks. Socks: The action will trigger by touching and holding for at least 0.5 sec and not moving left or right.

Sign In or Register to comment.