Same Objects Colliding Event - Get IIDs

Get help using Construct 2

Post » Mon Jun 25, 2012 2:26 am

How would I go about getting the IDs or Instance Variables of two objects (of the same instance) that collide with one another?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Mon Jun 25, 2012 10:40 am

o.o this is a very basic question can you upload .capx becuase we don't know what you really need..

if you want any object to collide with the same object just put a variable for them for example : enemy with variable (number) and make event if enemy collide with enemy destroy

i made this capx. is it what you looking for??
https://dl.dropbox.com/u/67034121/scirra%20construct2/collide%20to%20it%20self.capx
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Mon Jun 25, 2012 2:32 pm

The IID is based on the currently picked objects. If you have 5 sprites their IIDs are 0,1,2,3,4. If you pick any 2 of them, the picked ones IIDs will be 0 and 1.

pickIID.capx


*edit* the IIDs aren't based on the picked objects but 'pick nth instance' picks from the currently selected objects.ramones2012-06-26 15:41:08
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Mon Jun 25, 2012 6:46 pm

Worked perfectly Ramones. I didn't know that's how you could use the "nth" instance condition.

Thanks for the help as well zsangerous
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt, Lancifer and 27 guests