0 Favourites

Instance variable bug r51.2

  • I have created simple project for that. Plane has set health (instance variable) to 3, and there is a group, which goes active when it is hit. However when plane health is below/equal 0, each plane is destroyed not just this particular one, i'm shooting at (another thing is that I need to hit it 4 times, instead of 3).

    Again, as I'm new user I don't know if I'm doing everything fine :)

    Download

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • It's not a bug, it's how you've written the events. I wouldn't advise you activate and deactivate groups of events like that - it looks like you're trying to use them as functions, but they work more like a big "if group of events is activated" statement.

    What you've done works like this:

    1. Bullet collides with plane -> the "PlaneHit" group activates.

    2. In PlaneHit: If the plane health is <= 0, it destroys with an explosion.

    3. In PlaneHit: the next event is empty, so 'subtract 1 from health' affects all the planes. That's where your problem is. It doesn't remember the affected plane because it's an entirely different event.

    To make sure you reference the right objects, put the actions in the relevant event, and use subevents beneath that. Have you tried the beginner's guide? It shows how to take health off the ghosts and destroy them correctly, like you're trying to do with the planes.

  • Thanks for answer I will definetly check the guide :]

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