I have an iPhone game that involves destroying objects by touching them.
When I touch an collidable object, it is destroyed.
However, if these objects are stacked (I have many such objects being spawned at once), it destroys all of the objects that are on the spot that one touches.
All objects are moving around in x,y space, they all have a z of zero (it is a 2d game).
How do I make the game only destroy the topmost item (they have a z of zero, but objects look as if they are on top of one another) instead of destroying all of the objects when I touch a spot?
If it matters, I am using the FingerManager from the forums to dictate my 'touch' action.
asked Jun 07 '10 at 04:50 AM
Sounds like you need to destroy the touched object and then set a bool flag that will not allow any further touch destruction(s) until TouchPhase.Ended is reached (i.e. finger lifted).
answered Jun 21 '10 at 05:46 PM