How do I count the objects with an Instance Variable value?

Get help using Construct 2

Post » Mon Mar 09, 2015 3:09 pm

I randomly spawn objects in a family onto the layout. When they are spawned they are assigned one of a few specific instance variable values.

Later, I want to know at any given time how many objects exists with a specific instance variable value for a comparison condition. How can I retrieve this number?
B
28
S
8
G
2
Posts: 58
Reputation: 2,586

Post » Mon Mar 09, 2015 3:21 pm

Use either the System "Pick by Comparison" or "Pick by Evaluate" event. Both events will pick all instances of an object (or family) that match the specific conditions you set in the event properties. You can then get the item/families PickedCount variable.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, kiko2015, lukezero, RoaringPixels and 11 guests