When I clone an object in a family, where are it's instance variables copied from?

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • I'm trying to clone an object that's part of a family with a lot of variable attached.

    Problem is, when I drag the clone's first instance onto a layout, all it's variables are copied across from a completely different object in the family.

    So my question, when adding a new object to a family, how is it determined which values it inherits, how do I manipulate this? Knowing these things will be a substantial time saver as I can use existing objects as the basis for new ones.

  • When you clone an object within a family, new object will inherit everything from the family and the original.

    If you don't want those family variables, you can remove it from the family.

  • Thanks but I have multiple objects within the family, each with a large variety in defaults across each type. What I want to know is where the defaults are copied from, because it's not the values of the object I'm cloning, it seems randomly decided when I drag an instance onto a layout.

  • The default values are pulled from the last object instance you set the values on in the layout. I had seen this before but to test it, I built a simple project with 6 sprites in a family with 5 variables. When I drag an instance onto the layout, the variables are blank for text or 0 for a number. I edit that object and then drag a different sprite from the same family out and all the variables match what I set on the first. Then, if I edit those, the next object matches the new variables and so on. It's easy to test.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just tried your method and it doesn't seem to work:

    Alt link:

    giphy.com/gifs/z6QZbyKJKDE0aEhZQ5

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