- Home /
How to figure out when was the last click on an object?
The main idea of my script is:
A player earns points clicking on objects. I want to decrease an amount of points when he didn't click, f.e, for 5 seconds. I thought about storing the time of previous click and current click, but I don't think that fits very well.
What other solutions may be here?
Thanks.
Answer by william9518 · Oct 07, 2013 at 08:02 PM
Log every click onto an array and log the system time it was on. Sort the array, and find when the last clicked was.
Your answer
Follow this Question
Related Questions
Click on two objects to render third 2 Answers
How do I let the player interact with objects close to them? 1 Answer
How to left click to rotate a box in a same direction in Unity 2D? 1 Answer
Make OnMouse functions ignore GameObjects that pass in front of them 1 Answer
How to click only one once? 0 Answers