Family Instances Do Not Act Independently

Get help using Construct 2

Post » Mon Aug 10, 2015 7:39 pm

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?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Mon Aug 10, 2015 8:05 pm

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.
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Mon Aug 10, 2015 11:54 pm

@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!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests