Was working with families in C2, and began to wonder if there's a way to know the object type from a family event. For example, say we have the family Enemies with the sprite objects Enemy A, Enemy B, Enemy C, and I have the event "On Enemy collision with Player". I'd love to be able to add a sub-event along the lines of "if Enemy.type = "EnemyA"", but I'm not sure if there's any attribute like Enemy.type.
Of course, I could do this with a family instance variable, but I was wondering if there was any way to do it with system attributes.
Thanks in advance!
Actually you can't ! but you can compare something like height,width,animation frame name or ...
Actually there is trick you can use. Use "pick by UID" on each object you want to test, using the Family UID. Only the correct object type will succeed.
Develop games in your browser. Powerful, performant & highly capable.
Interesting trick! Thanks for the help