Family Instances Do Not Act Independently

0 favourites
  • 3 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • CAPX: https://www.dropbox.com/s/cnyihh7p7k4dsda/Gradient%20Run%20v%201-4.capx?dl=0

    EVENT SHEET: "E LEVEL OPS"

    EVENT LINE: 32 (see group HAZARDS / Visualizing the Hazards)

    CONTROLS: WASD (moves ship)

    For every "Arena Hazard" object (check the project folders and subfolders), there is an "Effect" object that is contained with it. When the player Ship overlaps any of the Hazard objects (HazardDamage, HazardSlow, HazardWeapon), it's related Effects object will fade into view. So long as the Hazard objects are only ever singularly overlapped (meaning the ship never overlaps more than one at a time), each Effect object will fade in (on overlap) and fade out (when not overlapped) appropriately.

    The problem I'm having is, if the Hazard areas are close enough that the ship might overlap more than one Hazard area at the same time, the first Effect object that becomes non-overlapped - as the ship moves from one to the next - remains visible when it should fade out. The moment I am not overlapping any Effect objects, all in question fade out to opacity 0.

    It is my understanding that Families of objects are treated just like normal objects, except that each object in a Family can be different from one another yet still considered an instance of the Family object as if they were copies of the same object. That being the case, per my event instructions, why does the Effect object formerly overlapped still remain visible even though there was a brief period of dual-overlap?

  • You have to watch "Is overlapping" - manual: True if any instance is overlapping any instance of another object.

    Put a For each before you overlapping test, to test each one, and you can switch NOT overlapping to an Else. Works then.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • blackhornet - As always, you're an incredible help. Thank you!

    To be more precise, I had to nest my original set up within the For Each event line. But it's definitely working now.

    God bless!

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