0 Favourites

Family Instances Do Not Act Independently

  • CAPX: https://www.dropbox.com/s/cnyihh7p7k4dsda/Gradient%20Run%20v%201-4.capx?dl=0


    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.

  • Construct 3

    Buy Construct 3

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

    Buy 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)
Similar Topics Posts Views Last Post
Unread hot topic
378 33,248
part12studios's avatar
Unread hot topic
99 10,124
karshinkoff's avatar
Unread hot topic Locked topic
115 17,199
Kyatric's avatar
Kyatric Construct Team Support