Objects in a family spawning with 0 health for their instance variable

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hello, making some tiles/cards with an HP value.

    Set to 4 initially for the family, but they weren't spawning.

    If I have one of these objects placed in the Layout already, before spawning them, everything works as intended and they come out with 4HP.

    But if spawned for the "first" time, they come out with 0, instantly destroying if I have that condition on.

    Anyone know why this is?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The first object spawned becomes the blueprint for all following instances. An easy fix is to have one instance either in your layout and remove it at the start, or have one created in another (unused) layout.

  • Yes, was thinking that could be a fix, wouldn't be too difficult.

    And that might help me establish other variables easily with an (on created) for the cards too if I load them up somewhere

    Hoping to understand why it wouldn't create an object with the instance variables set though.

  • Yes, was thinking that could be a fix, wouldn't be too difficult.

    And that might help me establish other variables easily with an (on created) for the cards too if I load them up somewhere

    Hoping to understand why it wouldn't create an object with the instance variables set though.

    Think of it less of a fix and more just that's how Construct works. It needs the initial instance to get info from. Or you can set 'on created' if you are applying to each instance manually.

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