Touching overlapped instances will return nothing.

Bugs will be moved here once resolved.

Post » Wed Aug 07, 2013 12:32 pm

Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/49730415/OverlappedButtons/index.html



Steps to reproduce:
1. Touch the sprite to get instance variable.
2. Change current layer.
3. Touch another instance of same sprite in new layer.
4. No instance variable returned if these 2 instance are overlapped.



Observed result:
Touching overlapped instances of same sprite gets nothing returned.

Expected result:
Should get overlapped instances' variable with correct condition.

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes
CocoonJS: yes

Operating system & service pack:
Win7

Construct 2 version:
r139



B
119
S
30
G
8
Posts: 214
Reputation: 13,160

Post » Wed Aug 14, 2013 4:51 pm

Closing, please follow the guidelines (we need your .capx)
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601

Post » Thu Aug 15, 2013 3:10 am

Sorry, pasted the wrong link.
Here's the capx.


https://dl.dropboxusercontent.com/u/49730415/OverlappedButtons.capx
B
119
S
30
G
8
Posts: 214
Reputation: 13,160

Post » Sat Aug 17, 2013 1:01 am

It's not no instance is returned but many instances are returned if overlapped, use a "for each button" in a sub event after the "on touched Button" to retrieve each instance of Button touched

So your code is not working when is no a unique answer.

Can't be seen and can't be touched is different, blind people see nothing but can touch many things ! ... so all your visible tests do nothing but you can add a condition "Button is on layer" with the "for each button" to retrieve only all touched buttons on a specific layer and in your case and because you have only one button on each layer you will get a unique answer.
naelian2013-08-17 01:41:09
B
18
S
5
G
3
Posts: 298
Reputation: 5,332

Post » Mon Aug 19, 2013 3:54 pm

Closing as not a bug, just a mistake in your events.

'On touched button' picks all three instances if you touch where they all overlap - it doesn't care which layers are visible. Then you have a system 'Layer Button.LayerName is visible' condition, which since is a system condition only checks one instance (Button.LayerName can only return one value even through three instances are picked, so it just returns the first). Solution: add 'For each button' just below 'On touched button' so you forcibly check every instance.
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest