How do I cog on collision with cog which is which

Just started using Construct 2? Post your questions here

Post » Wed May 06, 2015 12:34 pm

Hello;

If I am checking for a sprite colliding with the same kind of sprite I have

Cog on collision with Cog

How do I reference the first Cog, the one that did the colliding? They are both the same kind of sprite.
How do I reference the second Cog?

Is there some kind of "other" in this situation like in game maker?

Thanks for your time.
yours
Winkr7
B
33
S
8
G
3
Posts: 169
Reputation: 3,280

Post » Wed May 06, 2015 12:52 pm

You use a Family with that object in it. Then you have two unique objects to work with.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Wed May 06, 2015 1:21 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed May 06, 2015 1:24 pm

Without families using pick nth instance should work also:

System -> Pick nth Instance

If 2 instances collide, picking instance 0 will pick the first instance and instance 1 will pick the 2nd instance

ON collision Enemy with Enemy
Pick instance 0 ... do whatever
Pick instance 1 .. do whatever
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed May 06, 2015 2:40 pm

Thanks lots little Stain.
And thank you Little Hornet.

yours
Winkr7
B
33
S
8
G
3
Posts: 169
Reputation: 3,280


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests