Create object "Family" is not possible ?

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello everyone,

    I'm trying to create an object by selecting a Family, but it doesn't seem to work.

    Here’s the situation:

    I have a family called "SpriteFamily" that includes spriteA, spriteB, and spriteC.

    At the start of the layout, I use the action Create Object → SpriteFamily, but nothing gets created.

    I was expecting it to create all the sprites in the family — or did I misunderstand how families work? Why it is selectable on "Create Object"?

    Thanks for your help!

    Tagged:

  • When you create a family instance, it should create a random member - spriteA, spriteB, or spriteC.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I see, thats why, when I set an instance variable on family, it only takes one element.

    Would be nice to be able t do some thing like:

    for each Family member (edited from "Element")

    -> do action

    Is it possible ?

  • I'm not sure what you mean by element? There are family members (object types), and there are instances of those objects — which are also considered family instances.

    You can certainly loop through all existing family instances using For Each.

    But if you need to iterate over all object types in a family (even if no instances of them exist on the layout), you’ll need to use JavaScript. As far as I know, that's not possible with events.

  • I understood now. yes, JS is needed for this :)

    Thank you for the clear explanation !

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)