Picking in a for each loop

Get help using Construct 2

Post » Fri Jul 26, 2013 9:11 pm

Let's say , I create an object in a for each loop

For each Car
-- Create Car

Will the newly created car IN the loop be counted in the for each loop

OR does it only go thru the already existing cars BEFORE the loop was called

Example

When the For each loop runs , I have car 1

When I create car 2 , will car also create car 3 ? or should I do another for each loop

Thanks for reading and have a nice day
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Fri Jul 26, 2013 9:25 pm

Why not try it and find out?
B
44
S
13
G
7
Posts: 603
Reputation: 7,936

Post » Fri Jul 26, 2013 9:41 pm

I had a try at it , but I couldn't get a sure response because UID is variable and unreliable , so I wanted to hear it out from the mouth of the wolf , just to be sure ...
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Fri Jul 26, 2013 10:11 pm

Its like dividing by zero. You know its working if the universe doesn't explode.
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Fri Jul 26, 2013 10:27 pm

[QUOTE=Whiteclaws]
Will the newly created car IN the loop be counted in the for each loop

OR does it only go thru the already existing cars BEFORE the loop was called
[/QUOTE]

No it won't. The for each uses the SOL at the moment it starts the loop, it won't update the SOL while is running.

Here's the manual entry

Regards
B
34
S
8
G
5
Posts: 32
Reputation: 5,399

Post » Sat Jul 27, 2013 6:49 pm

@intiva

Thanks for the tip , mate

@newt ,

That's how they made the nuclear bomb
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436


Return to How do I....?

Who is online

Users browsing this forum: alajajm, imhotep22, ishmaelmoreno, Solomon, Yahoo [Bot] and 13 guests