pcprice76
I was dealing with a similar mouse issue last night - I was doing something when the left mouse button was clicked on an object. But I was also doing something while the left button was down in another fuction. Out of curiosity, I put a counter in that button down function, and it was getting called on average 9 times along with the first routine. And that was just a normal short mouse click.
Things generally happen a lot quicker than you think. I bet C2 thinks your "touch" event happens for quite a few ticks. On the first tick of the touch it creates the m.Glass, then the next tick thinks you are touching the m.Glass. so starts running that code. The 0.01 second delay may not be long enough.
Another issue I ran into months ago is that a tap on objects that overlap registers as a tap on all of them. So, you need to make a way to disable the first sprite while the m.Glass sprite is visible. Then re-enable it when you destroy the m.Glass one. Making the first sprite invisible will not work - the tap will still be processed for it. you have to disable the events where it processes the tap, or move the sprite off screen, or add conditions that say not to process the tap if the m.Glass sprite is overlapping or visible.
YES! You got it... my problem is the sum of your two ones.
I realized that more then one tap was triggered and i think that with WAIT was solved, because after that the M. Glass was showing up normally. The second issue is that clicking on it,it triggered both overlapping sprites, so, at the same time:
1) Function description, that describes object and destroy sprite m. Glass
2) Function object select that triggers the tap on underneath object and creates again the M. Glass on it.
So the M. Glass remain always on top of the object, never being destroyed (or, better, being destroyed and recreated at the same time)
In this case WAIT is useless because the problem is that TAP takes both objects and triggers 2 functions.
I could make the M. Glass appear shifted to the side of touch.X but would prefer to find a way to solve this porblem, 'cause i'm sure that can be useful in future..