Touching overlapped instances will return nothing.

0 favourites
  • 5 posts
  • 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

    <img src="http://i1220.photobucket.com/albums/dd443/gonzdevour/2013-8-74E0B534807-05-50_zps1675edd1.jpg" border="0">

    <img src="http://i1220.photobucket.com/albums/dd443/gonzdevour/2013-8-74E0B534807-06-04_zps3de5f916.jpg" border="0">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing, please follow the guidelines (we need your .capx)

  • Sorry, pasted the wrong link.

    Here's the capx.

    https://dl.dropboxusercontent.com/u/49730415/OverlappedButtons.capx

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)