- Home /
Android on 2nd touch destroy...
I have a game where angry cubes are chasing me.
I would like it so when I touch the cube two times it destroys itself. It would be unrealistic if it died on the first touch.
Any code is greatly appreciated...
Answer by roojerry · Sep 02, 2013 at 12:59 PM
The script attached to each cube should have a variable to keep track of the number of touches. Add to that every time a touch is registered on that cube. Make sure you only increment when a touch begins, so that a single touch won't get counted over multiple frames. Then, in the Update function you can check if(touchCount == 2)
destroy your cube
Your answer
Follow this Question
Related Questions
Android touch 3d Object event 1 Answer
Cannot touch cloned prefabs 0 Answers
Player doesn't stop jumping when stop touching the screen[Android] 1 Answer
Destroying GameController Respawns? 0 Answers
GUITexture Touch Problem 2 Answers