Reply To: Is there something between a public variable and a static public variable?

Forum Archive Is there something between a public variable and a static public variable? Reply To: Is there something between a public variable and a static public variable?

#38205

@jgonzalez Making a family class seems to be the way to go but I have a few more questions related to prefabs and inheritance. Let’s say I start the game with just two animals. I do this by instantiating 2 copies from the same prefab at the center of the game map.  What makes each animal unique is that in the prefab some of  their attributes, like speed and fertility, are chosen randomly. So when I instantiate each of them, the random number generator immediately gives them each their own unique attributes. Later on when the animals are big enough they have children and these children are instantiated from the child prefab. 

My first question is where to put the ” Family” class?  Would I make it inside the the script of the prefab that the original two animals derive from? 

Second, how do I make it so that each baby animal is inheriting the “Family” class of their specific parent animal and not the other animals “Family” class?