Extends the built-in Touch plugin's behavior with additional settings: Ignore invisible objects, don't click/touch through objects and others.
Hi Again valerypopoff!
found another thing
if two touchable objects are overlaping still both be touched even "Dont Touch Through Objects" checked
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.
really ?
if works it save alot of code..... tryng
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
Can't reproduce. Can you send me the project file?
seems it only happens if the object is spawned on your Layouter plugin! take a look on this record, i clicked through the falling objects even option checked...
loom.com/share/f152bff4e4a2466080a2c4ddaa7137a6
Yes, thanks for the video. I can see what you're talking about. Still, can you share the project file? Best if you can leave the minimum of objects, layouts and logic enough for the bug to persist
mediafire.com/file/mpnklrx1bi30c5z/Bug.c3p/file
Thanks!