start of layout + For each

Get help using Construct 2

Post » Fri Feb 28, 2014 11:46 pm

@RamPackWobble The for each blue sprite on line 2 runs exactly ten times, once for each iteration of the outer loop. The picked instances list after a "Create object" get limited to that particular instance, so the blue sprite already on the layout never get picked for line 2.

@t4u What I meant is if you create multiple objects in a single event and you want to iterate through them afterwards, you're better off duplicating the creation event and doing the iteration on this one. It's hard to explain, so here's a picture. The "creation event" is a simple "start of layout" in this case.

Image
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735

Post » Sat Mar 01, 2014 8:44 am

@Magistross - thanks for the explanation.
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 » Sun Mar 02, 2014 1:20 pm

Ty. Strange indeed.
B
4
Posts: 17
Reputation: 232

Post » Sun Mar 02, 2014 1:57 pm

You could also use "Wait 0" after creation and still use a sub event.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Previous

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 26 guests