Only first instance is effected

Get help using Construct 2

Post » Mon Feb 16, 2015 12:28 pm

I have a simple event:
IF Player is overlapping helpbubble
AND SimpleShadow variable objectID = HelpBubble.UID
THEN make both invisible

It only effects the first help bubble instance's shadow however. All the other instances of the help bubbles function normally except their shadows refuse to be effected by any actions I try to apply to them.
B
42
S
12
G
1
Posts: 231
Reputation: 3,825

Post » Mon Feb 16, 2015 12:39 pm

I assume you are assigning the help bubble's UID to each shadow and not just one of them ?
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Mon Feb 16, 2015 12:43 pm

Yeah the objectID variable stores the help bubble's UID. And the first help bubble instance's shadow only gets effected by this code.

I have the shadows get created and set their objectID variables to the help bubble UIDs when the help bubbles are created.
B
42
S
12
G
1
Posts: 231
Reputation: 3,825

Post » Mon Feb 16, 2015 12:47 pm

Well the problem must be in the code somewhere else then. Can we see a capx?
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Mon Feb 16, 2015 12:53 pm

After you got me thinking on different areas of the code and I tinkered around, it appears I had to change the on created condition for the family of objects that have shadows to a if flag is false condition with a for each loop for the family and turn it on immediately after shadows are created because for some reason on created screws up setting the variables correctly even when I put a for each loop.
B
42
S
12
G
1
Posts: 231
Reputation: 3,825


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, cjbruce and 8 guests