How do I spawn object once without it spawning every click

Get help using Construct 2

Post » Fri Feb 06, 2015 9:32 pm

Hi,
I have a sprite connected to the right mouse button, I want it to spawn only once, then I cant spawn it again for 10 seconds no matter how many times I click the right mouse button.

I have tried the wait expression, and the trigger once if true, none of them seem to work, any help would be great thanks.
B
10
S
5
G
2
Posts: 37
Reputation: 1,992

Post » Fri Feb 06, 2015 9:51 pm

Create a global variable called lastClickedTime and when the mouse is clicked, set it to the system time. Then in your event, add a new condition that says:
lastClickedTime <= time - 10

Capture.PNG
You do not have the required permissions to view the files attached to this post.
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Sat Feb 07, 2015 12:45 am

Thank you very much Frag :D
B
10
S
5
G
2
Posts: 37
Reputation: 1,992


Return to How do I....?

Who is online

Users browsing this forum: Fenix18, jorgmaquoi and 23 guests