Touch Plus (Construct 3 Plugins)

  • 16
    This content is deleted
    Addon
    Touch Plus

    Extends the built-in Touch plugin's behavior with additional settings: Ignore invisible objects, don't click/touch through objects and others.

You're viewing a single comment in a conversation. View all the comments
  • 6 Comments

  • Order by
  • Ok, I've investigated it and you're not gonna like what I'm gonna say))

    Here's the thing.

    What you see is not a bug in the TouchPlus plugin. It is a peculiarity of how Destroy action works in Construct when it gets the instances from a Touch condition when it comes to instances of the same object type. In your case you have ovelapping instances of the same object type "DropRecursos" (yes, it's a family but in this regard it is treated like an object type).

    You can check it by printing the instance's UID before the "Destroy" action and you'll see taht only one UID gets printed before both instances dissapear.

    • Actually, you don't even need to have TouchPlus plugin in the project to witness that. Create a new project, add Sprite, Browser and Touch. Put two instances of the sprite to the layout so they overlap. Then add events:

      "On touched Sprite" →

      Browser: Log in console Sprite.UID

      Sprite: Destroy

      Launch the project and click where two instances of the sprite overlap. Both of them will desappear. See the console: only one UID is printed.

      • I can't fix it with my plugin because I don't know why Construct behaves this way. Have you considered reporting this as a bug here github.com/Scirra/Construct-3-bugs/issues It's frustrating and it shouldn't be like this.

        In your case I'd recommend to change the logic behind destroying the instances that you click. When you click a Family instance, instead of Destroying it right away, call a function that destroys it. Pass an instance's UID to the function. In the function pick an instance with this UID and destroy it. I checked, it works. But. It will not destroy the topmost instance but the lower one. Again, not a bug in my plugin but a way Construct treats touching several instances of the same object type.

        My condolences.

        • This is very interesting. I didn't believe it until I reproduced it myself. If you add a "For each Sprite" condition under the "On touched" then it works as expected.

        • No problem Valerypopoff, i already have changed the "destroy" action with function > UID already, and works great with you plugin.

          I will make the report soon, two reports pending now rolf