Say I have a function that works for several objects, and these objects are in a family.
I need a way to figure out which member of the family is being used, or in my current line of thinking, I do. Is there a way to do this, or some clever method of determining this?
Adding a variable to this objects and setting a different value for each one to compare it later?
Develop games in your browser. Powerful, performant & highly capable.
It might help to have some context - what do you mean by 'being used'?
You mean if you had a family called 'pets' which contains 'cat' and 'dog' objects. And you want to know if the currently picked pets is a cat or dog?
You could do it with an event like this:
pick cat by uid pets.uid
It will only run if pets is a cat.
If I understood you correctly, you could do this:
.. familyMember1 pick by uid Family
.... Do stuff for familyMember 1
.. familyMember2 pick by uid Family
.... Do stuff for familyMember 2
Edit: The Hound beat me to it :)
Thanks everyone for all the help!
To elaborate more on what I'm trying to do - basically I'm creating a complicated snake. Except there are several snakes and I need to find out which snake I'm working with :)