Checking collision between 2 objs of same family

Get help using Construct 2

Post » Thu Apr 25, 2013 7:28 am

[QUOTE=JoyfulDreamer] I'm having this same issue. I have instance variables attached to a family and I have to test collision between the SAME family, and access those variables at the same time between both! :/ Is there still no good solution for this?[/QUOTE]

Here is one solution, I don't see why it wouldn't work with families as well:

Evil sprites example

You could save variable values from picked instance into local variable, and compare those to variables of other instance. Then react accordingly.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Thu Apr 25, 2013 10:04 pm

That's odd. I swear I tried something similar already, but the example seems to work. Better go back and try again. ;) I guess the docs were not too clear on what happens if 3 touch - does it trigger once for all objcets, or ONLY each pair on collisions? (so if 3 objects hit, then the trigger occurs 3 times) I guess it would seem so.
Jack of all trades, and master of some.
B
29
S
9
G
7
Posts: 174
Reputation: 7,601

Post » Sun Dec 08, 2013 10:47 pm

[QUOTE=vee41]
Here is one solution, I don't see why it wouldn't work with families as well:

https://dl.dropboxusercontent.com/u/19921470/evil_sprites_demo.capx
Evil sprites example

You could save variable values from picked instance into local variable, and compare those to variables of other instance. Then react accordingly.[/QUOTE]

Thanks! That evil sprite demo showed exactly what I was looking for! I've just started experimenting with C2, so I didn't know I could grab the UID and use pick instance in that way. CrossBread2013-12-08 22:50:19
B
8
S
1
Posts: 13
Reputation: 450

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests