Spawned Copies of Sprites

Get help using Construct 2

Post » Sat Feb 02, 2013 4:32 pm

Just one other thing, is there a way to identify the total number of instances spawned for an object. If I can get the total number of IIDs, I can select the last one as the child and the penultimate one as the parent.
B
5
Posts: 19
Reputation: 363

Post » Sat Feb 02, 2013 4:55 pm

instance.count seems the way to go.
B
5
Posts: 19
Reputation: 363

Post » Sat Feb 02, 2013 5:23 pm

Every object has object.count function which returns number of specific object instances in the game. So carn.count returns total number of carn instances in the game.

You can use 'pick all' in system menu to pick every single instance of the object, then you could use 'pick nth' instance in system menu to pick object.count-1 to pick last (latest) instance of the object. Or which ever instance you desire.

Hope this answers your question :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Sat Feb 02, 2013 8:09 pm

Yes indeed!
B
5
Posts: 19
Reputation: 363

Previous

Return to How do I....?

Who is online

Users browsing this forum: alextro, Google [Bot], MarkStockley and 0 guests