Trigger Once (event/action)

For questions about using Classic.

Post » Fri Feb 27, 2009 7:26 pm

How do I let an overlapping-event run once when met with a certain condition, stop and (and this is what fails with me:) run again when conditions are met again.

My attempt at pseudo-code:

>if block1 and block2 are overlapping
+ add 1 to private variable 'counter'

When I run this, upon the 2 blocks overlapping eachother, the action gets executed as long as the events are overlapping, resulting in a counter that keeps counting (instead of only adding 1 number).

I have tried "trigger once", but after block2 moves away and returns to overlap block1 again, it should add 1 again, but the event really only triggered once and doesn't get activated again.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Fri Feb 27, 2009 7:48 pm

Use "On collision." It's the same as overlap, but only triggers once per overlap.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Mar 03, 2009 4:09 pm

Thanks, it works.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests