Touch Gesture Problem: Clicking Newly Moved Object

0 favourites
  • 4 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi guys, I'm currently working on a menu system for an experimental tower defense game similar to Radiant Defense (the menu is an exact rip-off, I know, but I'm just using it as a base) and I'm using the On Tap Object condition.

    My problem is, since I'm just moving my buttons on-and-off the screen (on a non-scrolling layer), the 6th button on the top menu happened to be perfectly aligned with the Cancel (3rd) button on the 4th menu, which causes the button to "seemingly" not do anything -- while in fact, it is actually moving to the 4th menu and quickly touching the Cancel button so the 1st menu is re-shown (it all happens so fast it can't be seen) -- the proof I know the 6th button works is because if I move it elsewhere it shows the 4th menu just fine. I know I'm only performing the Tap Gesture once since I'm keeping the left mouse button clicked when I touch the button.

    My question is, is there a way to prevent the On Tap Object condition from executing multiple times? I'm halfway tempted to just use one big menu screen where the buttons will never stack over each other, but that seems like a bad workaround.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Give an instance variable like 'tap_times'. So when an object being touched add 1 to the instance variable 'tap_times'. Then on your desired condition event add 'tap times' <= 1 then do the rest action.

  • Thanks for trying to help, I really appreciate it

    However, I have figured out a workaround:

    Just before the final action in the On Tap Object event, add a System.Wait for 0.01 seconds.

    Apparently that was enough to keep the Touch Behavior from executing right after the function was called so the re-check on the Cancel button's Touch event never fired unnecessarily.

    I hope this issue gets fixed soon, if it actually is an issue or just a mouse-emulating-touch limitation.

  • Well I never use gesture input only basic touch function such as 'On touched object' or 'Is touching object'. Using these basic touch option I am able to emulate mouse gesture.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)