multiple creation actions in 1 event

For questions about using Classic.

Post » Sat Jan 24, 2009 9:09 am

At the moment i'm using fastloops to create multiple instances of an object at the same time and giving them a unique id and values, but i also tried doing,

my conditions > create object
set object variable id to 1
create object
set object variable id to 2
create object
set object variable id to 3

all in the same event, but it didnt work. Should it work?

I'm really just wondering, as my fastloop method works fine.

Thanks.
B
39
S
20
G
19
Posts: 655
Reputation: 11,001

Post » Sat Jan 24, 2009 2:12 pm

When you create two objects in the same event, both are picked, so a 'set private variable' action will modify both of them, not just the last created one.

Try creating them in separate iterations, eg:

+ For "i" from 1 to 3
-> Create object
-> Set variable to loopindex
Scirra Founder
B
373
S
218
G
83
Posts: 23,433
Reputation: 185,806

Post » Sat Jan 24, 2009 2:55 pm

Thanks, that reduced and simplified my events somewhat.

Have to get out of the mmf way of thinking.
B
39
S
20
G
19
Posts: 655
Reputation: 11,001


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests