object create problem?

Get help using Construct 2

Post » Tue Jul 28, 2015 12:47 pm

Hi, in my game I have a claw that releases a ball when you click on 'xyz' then after 0.3 seconds it will spawn another ball in the same spot to replace the last one. everything works fine but the issue is that if you just click on 'xyz' really quickly between each spawn then it will spawn like 5 balls instead of the 1. How can i make a condition that there can only be one ball there at a time?

Thanks guys
B
3
Posts: 36
Reputation: 253

Post » Tue Jul 28, 2015 1:32 pm

I'm guessing you are using a wait action in the click event..
I would recommend not doing that, but well..

Adding a boolean variable to xyz and setting it to true on clicked and false after the creation of the new object might work..

Then you'd just have to add a condition xyz is not boolean and the player wouldn't be able to click xyz untill the new object is created..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 28, 2015 3:54 pm

Perhaps try a "Trigger once while true" condition. This has the effect of pausing any repetitive action sets for around 5 seconds or so, before it will be considered "available for use".
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Tue Jul 28, 2015 4:06 pm

gumshoe2029 wrote:Perhaps try a "Trigger once while true" condition. This has the effect of pausing any repetitive action sets for around 5 seconds or so, before it will be considered "available for use".


5 seconds? Where did you get that info?
As far as I know it will trigger again the moment the event becomes true again after it has been false..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Aug 02, 2015 2:55 am

@littlestain yes haha I did you a wait event :S. is that bad?

How do I write out the coding for what you said? I think I understand the first half just not the second?

Thank you
B
3
Posts: 36
Reputation: 253

Post » Sun Aug 02, 2015 7:47 am

how about

https://db.tt/3jwez9Ni (r210 beta)

?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Thu Aug 06, 2015 8:27 pm

@RamPackWobble Works perfectly!!!
B
3
Posts: 36
Reputation: 253


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 16 guests