How do I get out of loop?

Get help using Construct 2

Post » Thu Dec 10, 2015 7:19 am

hi!
the example is:
I am comparing two variables A and B.
if A is more than B, add 5 to C.

But C becomes infinite.

what I want is add 5 to C once when "if" is true.
And of course i know the SET function. and it is not worth it. i think u know why it doesn't worth it.

Maybe it is dull question. But plz help me is there any simple way?
B
7
Posts: 16
Reputation: 348

Post » Thu Dec 10, 2015 9:04 am

A simple way is to introduce a new boolean variable, and toggle it once it has added 5 to C once.

doOnce = false;
if (A > B && doOnce == false) {
doOnce = true;
C += 5;
}
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Fri Dec 11, 2015 9:54 am

Thank you i appreciate your help
B
7
Posts: 16
Reputation: 348


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, ismael123, lennaert and 8 guests