What is wrong with this code?

Get help using Construct 2

Post » Fri May 11, 2012 11:15 am

Hi all,

Yesterday i updated from r84 to r89. After that one of the events didn't work properly anymore. It seems I can't figure out what I'm doing wrong, so maybe you guys/girls can help me out.

Situation: I have several instances of a Text object. When a text object has content, place a sprite over it. When a text object has no content, delete the sprite over that particular text object instance.

Creation is no problem, but deletion isn't working anymore after.

The code for deletion is:
Sprite > is overlapping Text: no action
[subevent]: Text > has no content: Destroy Sprite.

Before this worked, now it only works when none of the instances have content.

I hope this explanation is clear enough, if not, let me know!

Thanks in advance,
MAD (Mark aka Dark)
B
19
S
6
G
3
Posts: 33
Reputation: 2,712

Post » Fri May 11, 2012 11:39 am

Try adding 'For each Sprite' above the 'Sprite is overlapping Text' condition. 'Is overlapping' used to have a built-in for-each, but if you specifically need per-instance behavior you need to add it in again now.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri May 11, 2012 11:54 am

[QUOTE=Ashley] Try adding 'For each Sprite' above the 'Sprite is overlapping Text' condition. 'Is overlapping' used to have a built-in for-each, but if you specifically need per-instance behavior you need to add it in again now.[/QUOTE]

Thanks,

That did the trick.
B
19
S
6
G
3
Posts: 33
Reputation: 2,712


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests