How do I determine if an instance is in a family?

Get help using Construct 2

Post » Mon Aug 03, 2015 3:51 pm

Hello;

I have a UID I pass to a function and I want to know if this is an instance of an object in a specific family (like is UID a member of the "enemy" family?).

thanks for your time.
yours
Winkr7
B
34
S
8
G
3
Posts: 169
Reputation: 3,305

Post » Mon Aug 03, 2015 4:15 pm

I don't think there are any way to check if an object is part of a family. But you can create them with a variable that you can use instead.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Mon Aug 03, 2015 7:22 pm

Yes it's possible, basically, if "pick familyA by UID" actually retrieve a familyA instance, then the UID refers to an object from the familyA, otherwise, it's not. Knowing that you can create a function for each family and end up with something like this : https://dl.dropboxusercontent.com/u/700 ... amily.capx
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue Aug 04, 2015 5:00 pm

Thanks Magistross. It looks like that works.

yours
Winkr7
B
34
S
8
G
3
Posts: 169
Reputation: 3,305


Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 34 guests