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…
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…
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