How do I add a wait time for Dragging

Get help using Construct 2

Post » Sat Jul 19, 2014 3:21 pm

What should I do to allow and start dragging an object if its held for a second or so. I can enable the drag after 1 second but it doesn't pick it up until the next tap.
Image Image Image Image
B
19
S
1
Posts: 89
Reputation: 929

Post » Sat Jul 19, 2014 3:40 pm

Firstly you should add Touch event (is touching object) and then you add new action: system -> Wait -> 1 and after that you add action what enables the drag.
B
3
Posts: 8
Reputation: 191

Post » Sat Jul 19, 2014 3:46 pm

VerteX123 wrote:Firstly you should add Touch event (is touching object) and then you should add new condition system -> Wait -> 1 and after that you add action what enables the drag.

I want to pick it up not enable it
on hold object > Wait 1 sec > Pick it up
what you're saying will require the user to touch it once to enable it and again to drag it.
Image Image Image Image
B
19
S
1
Posts: 89
Reputation: 929

Post » Sat Jul 19, 2014 4:00 pm

Message: VerteX123 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
oh yes, sorry, I misread. Actually I have almost the same problem myself:

But haven't found solution to it.
In C2 there could be actions for automatic input, I'm not sure if it's possible to do.
B
3
Posts: 8
Reputation: 191

Post » Sat Jul 19, 2014 6:02 pm

@C91Designs @VerteX123

I've attached a commented capx that should do what you want. The key was to have Drag enabled always, but not actually allow movement until a variable was set after a timer.

You have to touch (or mouse left-click-hold) the sprite for one second before it will drag.

If you try to drag it before then it will just stay in the same spot.

If you drag off the sprite before the timer runs to allow drag, it will drop and you have to re-touch again if you want to drag.

Edit: Changed capx so the sprite changes colour - red = can't drag, orange = getting ready to drag, green = can drag
You do not have the required permissions to view the files attached to this post.
Find all the Construct 2 games that were on Steam Greenlight here
B
33
S
9
G
7
Posts: 451
Reputation: 6,782

Post » Sun Jul 20, 2014 4:50 pm

Thanks a lot!
Image Image Image Image
B
19
S
1
Posts: 89
Reputation: 929


Return to How do I....?

Who is online

Users browsing this forum: BackendFreak, farsen, kellehk, lahbach, newt, R0J0hound, TRMG and 26 guests