# Picking in a for each loop

Get help using Construct 2

### » 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
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

### » Fri Jul 26, 2013 9:25 pm

Why not try it and find out?
B
48
S
15
G
8
Posts: 603
Reputation: 8,766

### » 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
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

### » Fri Jul 26, 2013 10:11 pm

Its like dividing by zero. You know its working if the universe doesn't explode.
B
178
S
50
G
206
Posts: 8,688
Reputation: 127,719

### » 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,404

### » Sat Jul 27, 2013 6:49 pm

@intiva

Thanks for the tip , mate

@newt ,

That's how they made the nuclear bomb
B
44
S
18
G
17
Posts: 2,249
Reputation: 17,585