- Home /
Question by
mmuhammedckurtu · Nov 28, 2019 at 07:19 PM ·
c#clickbasicsecondsbasic programming
Cliks per second does not work
Hi, i am trying to make a clicker game but i have a problem with clicks per second. When i click the button it is work but for 1 second then it reset. And it start again. For example , i am clicking 3 times every second but it turns like that: first 3/s then 0/s,1/s,2/s,3/s .... this is happining every second.I want that if i click 3 times per second it shows all the time it until i stop, but it resetting every 1 second.
public void perSecondBooks()
{
if (counter < 1f)
{
counter += Time.deltaTime;
perSecBooksText.text = perSecBooks.ToString()+"/s";
}
else {
perSecondBook = 0;
counter = 0;
}
}
Comment