How do I set family variable to different values

  • I think I asked this wrong in beginners,

    How do I a set a family variable to different values for some members?

  • Pick the member object.

    Set the variable.

    Edit: I have updated my example from the other forum where you asked this. Let me know if it helps.

    [attachment=0:3ddb38in][/attachment:3ddb38in]

  • I am not sure how to pick the specific member, that's the part I am very confused on.

    I tried to to set in 'on create' but it stays global for all

    example:

    enemy1 on create ---> set Family Variable HP to 5

    as soon as any enemy1 loses 5 HP they all blow up

    I know I have to solve this before I go any further, to have enemy1, enemy2, ect to have all different HP.

    Or is this something Families can't do, and I will have to set up Hit Points and collision events for each enemy type?

  • Check the capx... I picked the object by mouse right-click but you could give them a unique number (other than the UID) or a name, etc. As you can see the individual HP variable for each object is changing separately. Go to the layout and set HP of each instance in the editor.. it will still work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK I was looking at the wrong project, the family .capx in other post was just what I needed to get going. Now I'm going breakdown so I fully understand each part.

    This has had me stumped for 8 hours (im slow i guess )

    Thanks!!!!

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