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
37
S
19
G
18
Posts: 613
Reputation: 10,231

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
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

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
37
S
19
G
18
Posts: 613
Reputation: 10,231


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests