How do I detect if my "touch" has a continuous hold *SOLVED*

Get help using Construct 2

Post » Fri Jul 04, 2014 6:06 am

The iPad has a feature where if you "touch" anything such as text, it treats it as a single click. However, if you hold your "touch" it offers a new option to copy. I want to utilize this feature in a different way.

Touch and release > Spawn ONLY one object
Touch and hold > Spawn several objects until touch is released.

Anyone now how to use this? Thanks!
Last edited by Domino3057 on Sat Jul 05, 2014 4:05 am, edited 1 time in total.
B
6
Posts: 27
Reputation: 402

Post » Sat Jul 05, 2014 4:04 am

For anyone interested or for future reference, I think I have found a solution.

I needed to be able to do this:
Touch and release > Spawn ONLY one object
Touch and hold > Spawn several objects until touch is released
-------------------------------------------------------------------------------------------------
I solved it with a global variable. Here is the simplified version:
Create Global variable: "Shoot"
If "Shoot" = 0, "on any touch start" Spawn object
System Wait 0.2 seconds set "Shoot" = 1
If "Shoot" = 1, Is in touch Spawn object
On any End touch, Set "Shoot" = 0
B
6
Posts: 27
Reputation: 402


Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 7 guests